I'm developing a mobile web application with the compact API build. The base API download is about 137 KB. On a slow 3G connection this file can take a couple of minutes or more to download. The browser appears to be downloading this file on every startup, rather than fetching from its cache. Some of the related API files (InfoWindow.css, svg.xd.js, etc.) do get pulled from the browser cache.
It looks like the ESRI server is responding differently with these files. For the base API file, the response headers include:
But for the other files pulled from browser cache, the response includes:
Expires:Sat, 27 Apr 2013 18:35:32 GMT
Apparently having the Last-Modified setting causes the browser to fetch from cache on subsequent requests, assuming the max-age date isn't exceeded (which in this case is set to about a year ahead, in seconds).
Last-Modified:Fri, 23 Mar 2012 03:11:06 GMT
Is this intentional -- to have the browser always download a new copy of the base API? Is there any way to force the browser to use a cached copy? I'm thinking of experimenting with a proxy that would feed the API with a directive to fetch from cache, but not sure that would work either. It's a pretty painful experience for users who have to wait for that startup on slow mobile connections - it could force us to abandon the map or the JS API altogether.