Firefox not honoring must-revalidate cache headers returned by jQuery.ajax() request
- by Oliver Weichhold
UPDATE 1: Judging by this thread I am not the only one having this problem in FF
12 and only in 12.
UPDATE 2: The problem does not seem to be limited to Ajax requests. From the looks of it everything that makes it into Firefox 12's cache will be fetched from there. No matter what. The server can specify cache control headers all day long. Bummer!
What I'm trying to achieve is the following behavior:
Browser may cache the response without revalidating for up to 5 minutes
I don't care if the browser revalidates on every request (Both Chrome and IE9 do for example)
When the expiration is up the browser MUST revalidate (which in my case will result in fresh data)
Chrome and IE9 exhibit the desired behavior when issuing a jquery.ajax() request with ifModified: true and cache: true while Firefox 12 never revalidates, which poses a serious problem.
These are the actual response headers:
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 03 Jun 2012 07:13:43 GMT
Content-Type: text/javascript; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: private, must-revalidate, max-age=300
Last-Modified: Sun, 03 Jun 2012 07:07:13 GMT
Content-Encoding: gzip
Any suggestions?