views:

541

answers:

1

We have a web app that runs on the iPhone.
The manifest file is ok, and the resources(html, css, js) are cached correctly.
The page sits in the home screen.

The trouble is, when the page loads a resource from the cache, there is as well a GET call to the server to read the Cache Manifest file.
The server is configured to send the correct header (max-age=31536000; public, etc...) and caches well all other files except the cache manifest itself.

Is this a normal behavior? It looks there is a slight lag, because of that call, for each resource load.
Any idea, if these multiple calls can get a status 304 or even better avoided?

+1  A: 

you should check the spec for details, but it would be logical for the manifest file to be regularly checked for updates (every session, or every hour or ...) and for it not to follow http-header-cache directives, but it would not be logical if that would happen on each and every request for a file in cache.

so this might actually be a bug in your code or in mobile safari?

the spec mentions support for a http 304 response code, so making sure that is send might indeed be a solution.

futtta
Thanks for the answer. I was loading resources through an iframe. Each time an iframe was loaded, the cache manifest was called, XHR does not have this problem. --> no more iframe loading ;)
Mic