How to avoid the ADS cache issue

If a user runs exactly the same CDS API request several times, and the data from the first time the request is submitted is still in the ADS cache. then the same data are retrieved from the cache, rather than being re-extracted from the dataset.

For datasets which are updated on a daily basis (such as CAMS global atmospheric composition forecasts), this can cause issues, as the later request may not be returned the data as expected.

To avoid this, we suggest users to add the keyword 'nocache' in their CDS API request, with a random numeric string which is changed each time the request is submitted e.g.:

'nocache': '123'

Hope that helps!

Hi! but for example were i have to add the command 'nocache' : '123' for example in the following API request:

import cdsapi

c = cdsapi.Client()

c.retrieve(
‘reanalysis-cerra-height-levels’,
{
‘variable’: ‘wind_speed’,
‘height_level’: ‘100_m’,
‘data_type’: ‘reanalysis’,
‘product_type’: ‘analysis’,
‘year’: ‘2020’,
‘month’: [
‘01’, ‘02’, ‘03’,
‘04’, ‘05’, ‘06’,
‘07’, ‘08’, ‘09’,
‘10’, ‘11’, ‘12’,
],
‘day’: [
‘01’, ‘02’, ‘03’,
‘04’, ‘05’, ‘06’,
‘07’, ‘08’, ‘09’,
‘10’, ‘11’, ‘12’,
‘13’, ‘14’, ‘15’,
‘16’, ‘17’, ‘18’,
‘19’, ‘20’, ‘21’,
‘22’, ‘23’, ‘24’,
‘25’, ‘26’, ‘27’,
‘28’, ‘29’, ‘30’,
‘31’,
],
‘time’: [
‘00:00’, ‘03:00’, ‘06:00’,
‘09:00’, ‘12:00’, ‘15:00’,
‘18:00’, ‘21:00’,
],
‘format’: ‘netcdf’,
},
‘download.nc’)

Hi,

import cdsapi

c = cdsapi.Client()

c.retrieve(
‘reanalysis-cerra-height-levels’,
{
‘variable’: ‘wind_speed’,
‘height_level’: ‘100_m’,
‘data_type’: ‘reanalysis’,
‘product_type’: ‘analysis’,
‘year’: ‘2020’,
‘month’: [
‘01’, ‘02’, ‘03’,
‘04’, ‘05’, ‘06’,
‘07’, ‘08’, ‘09’,
‘10’, ‘11’, ‘12’,
],
‘day’: [
‘01’, ‘02’, ‘03’,
‘04’, ‘05’, ‘06’,
‘07’, ‘08’, ‘09’,
‘10’, ‘11’, ‘12’,
‘13’, ‘14’, ‘15’,
‘16’, ‘17’, ‘18’,
‘19’, ‘20’, ‘21’,
‘22’, ‘23’, ‘24’,
‘25’, ‘26’, ‘27’,
‘28’, ‘29’, ‘30’,
‘31’,
],
‘time’: [
‘00:00’, ‘03:00’, ‘06:00’,
‘09:00’, ‘12:00’, ‘15:00’,
‘18:00’, ‘21:00’,
],
‘format’: ‘netcdf’,
'nocache' : '123',
},
‘download.nc’)

Thanks