ExportMap Returns Path to Deleted Temporary File

2561
1
07-06-2011 08:22 AM
TylerOhlsen
New Contributor
When calling ExportMap with a JSON return format, an HREF field is included with a URL to the image you requested.  After a configured amount of time (maxFileAge), that temp file is deleted.  Now after that temp file is deleted, if I call the original query url again I receive a JSON message with the exact HREF field value as in the previous call and navigating to that url returns a 404 file not found error.

BTW, I am calling to the World Imagery service so I have no control over changing server parameters.  I am assuming maxFileAge is set to about 5 minutes and I am receiving the same href url up to 60 minutes after the first query.  After 60 minutes, I get a new href url with a valid image (again for only 5 minutes) and so on.

Tyler
0 Kudos
1 Reply
RaviNarayanan
Esri Contributor
The response header for an exportMap request contains the following cache-control header for this service:

http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export?bbox=-20037507.22...

Cache-Control private, max-age=3527

Browse might be caching response in this case for upto 3527 seconds.

you could try adding a timestamp parameter to the request so each request is unique

http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export?bbox=-20037507.22...<currenttimeinms>

for example

request #1
http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export?bbox=-20037507.22...

request #2
http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export?bbox=-20037507.22...
0 Kudos