I have a web application with a custom web server, and I am having problems with web kit browsers that do not cache images, stylesheets, and javascript.
I tracked it to some relationship between Cache-Control: max-age and Last-Modified. If both are specified, then webkit seems to ignore the maximum age header and checks if the file was changed EVERY time the resource is used. The site has an iframe on the first page, and this leads to stylesheets, etc. Requested twice in a second!
If you delete Last-Modified, the files will not be re-requested until the next day; however, requests for the next day will no longer be changed if there are requests that require the server to re-send everything, not just the 304 header.
In IE9, Firefox 10.0 and Opera 11.61, browser caches are correct and are not re-requested, but only HTML, which has an attribute for the cache control header: no cache.
In Chrome 16.0.912.77 m and Safari 5.1.2 (7534.52.7), each time for each image on each page, a conditional query is executed. The server responds with a 304 header, again containing the max-age attribute, but they both continue to request.
An example of an HTTP header that I am sending with a response:
HTTP/1.1 200 OK
Date: Mon, 06 Feb 2012 15:12:12 GMT
Cache-Control: max-age=86400
Content-length: 708
Content-type: image/gif
Last-Modified: Fri, 6 Jan 2012 14:39:07 GMT
Server: Webspring
Does anyone have any suggestions on how I can get these browsers to respect my cache headers?
Win7 Pro x64, HTTP - Fiddler, .
. , , . , .
Mog