IE caching responses to GP.submitJob callbacks?

1000
2
Jump to solution
07-16-2013 10:15 AM
DaveHighness
Occasional Contributor II
This problem is occurring only in Internet Explorer. It is not happening in Firefox, Chrome or Safari.

I have a ArcServer Javascript API v3.1 application that runs several asynchronous ArcServer GP tasks using the GP.submitJob method. What appears to be happening is IE is caching the GET URL calls to the ArcServer REST when the URL is the same as previous calls. I get a 200 response from the REST when the URL hasn't been used before. But when the URL has been used before I get a 304 response. When the Job Status callbacks occur using the same URL, IE is returning the same cached value each time and never returning the Job Completed code. The GP.submitJob gets stuck in an infinite loop.

How can I use the GP.submitJob and keep this from happening? Can I force it to use POST? Can it append a random string variable so each GET URL is unique?

Thanks, Dave
0 Kudos
1 Solution

Accepted Solutions
DaveHighness
Occasional Contributor II
Alright so this is a bug in IE. IE is using cached responses to GET REST calls. ESRI Tech Support gave me a fix that should probably be included by default. Place the "esri.setRequestPreCallback()" function after you've initialized the map. This will add a Dojo prevent cache random variable to your GET URI when a "GPServer" request is made. He said that this is also a good idea for feature services.

         map = new esri.Map('map', {             extent: initialExtent,             fitExtent: true,             slider: true,             nav: false,             logo: false         });          //Add this to force Dojo to add a random variable to GP GET URLs         esri.setRequestPreCallback(function (ioArgs) {             if (ioArgs.url.indexOf("GPServer") > -1) {                 ioArgs.preventCache = true;             }             return ioArgs;         }); 

View solution in original post

0 Kudos
2 Replies
DaveHighness
Occasional Contributor II
Yo, anyone have any ideas on this?
0 Kudos
DaveHighness
Occasional Contributor II
Alright so this is a bug in IE. IE is using cached responses to GET REST calls. ESRI Tech Support gave me a fix that should probably be included by default. Place the "esri.setRequestPreCallback()" function after you've initialized the map. This will add a Dojo prevent cache random variable to your GET URI when a "GPServer" request is made. He said that this is also a good idea for feature services.

         map = new esri.Map('map', {             extent: initialExtent,             fitExtent: true,             slider: true,             nav: false,             logo: false         });          //Add this to force Dojo to add a random variable to GP GET URLs         esri.setRequestPreCallback(function (ioArgs) {             if (ioArgs.url.indexOf("GPServer") > -1) {                 ioArgs.preventCache = true;             }             return ioArgs;         }); 
0 Kudos