@@ -47,7 +47,7 @@ def __init__(self, tap_handler=None):
47
47
self ._rmf_ftp = str ("http://sasdev-xmm.esac.esa.int/pub/ccf/constituents/extras/responses/" )
48
48
49
49
def download_data (self , observation_id , * , filename = None , verbose = False ,
50
- ** kwargs ):
50
+ cache = True , ** kwargs ):
51
51
"""
52
52
Download data from XMM-Newton
53
53
@@ -110,7 +110,9 @@ def download_data(self, observation_id, *, filename=None, verbose=False,
110
110
if verbose :
111
111
log .info (link )
112
112
113
- response = self ._request ('HEAD' , link , save = False , cache = False )
113
+ # we can cache this HEAD request - the _download_file one will check
114
+ # the file size and will never cache
115
+ response = self ._request ('HEAD' , link , save = False , cache = cache )
114
116
115
117
# Get original extension
116
118
_ , params = cgi .parse_header (response .headers ['Content-Disposition' ])
@@ -122,7 +124,7 @@ def download_data(self, observation_id, *, filename=None, verbose=False,
122
124
123
125
filename += "" .join (suffixes )
124
126
125
- self ._download_file (link , filename , head_safe = True )
127
+ self ._download_file (link , filename , head_safe = True , cache = cache )
126
128
127
129
if verbose :
128
130
log .info ("Wrote {0} to {1}" .format (link , filename ))
0 commit comments