Since we use a cache buster with versioned filenames for all CSS+JS,
the problem has to come from the main html page.
I got an example of what is happening.
First query to
http://laurent.dev.wikiotics.net/new/flashcard_deck?template=podcast at
14:04 (haven't opened that page in over 24h)
response headers below:
=============================================
HTTP/1.1 200 OK
Server: nginx/1.1.19
Date: Mon, 30 Jul 2012 12:04:21 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Language: en
Expires: Tue, 31 Jul 2012 12:03:40 GMT
Vary: Accept-Language, Cookie
Last-Modified: Mon, 30 Jul 2012 12:03:40 GMT
Cache-Control: private, max-age=86400
x-frame-options: SAMEORIGIN
Set-Cookie: csrftoken=k4vMl5kFrw3pc5uddxqTUhhUKXwtz5c1; expires=Mon,
29-Jul-2013 12:03:40 GMT; Max-Age=31449600; Path=/
Content-Encoding: gzip
=============================================
then updated the code on the server (only a change in base.css, nothing
else).
Same url reloaded in the same browser gives me the same page (headers
below), note the 304 NOT MODIFIED response from nginx.
=============================================
HTTP/1.1 304 NOT MODIFIED
Date: Mon, 30 Jul 2012 12:13:35 GMT
Expires: Tue, 31 Jul 2012 12:03:40 GMT
Vary: Accept-Language, Cookie
Last-Modified: Mon, 30 Jul 2012 12:03:40 GMT
Cache-Control: private, max-age=86400
=============================================
Same page loaded in a different browser (not previously cached) shows
the updated content (ie the <hash>.css file is different and is what I
expect)
So I think what is happening is that nginx does not see that
django-compressor implicitly modified the content of the HTML file (by
changing the hash in the filenames) and thus keeps serving the same
content for up to 24h. So my guess on a bug in FF above was a mistake.
From a quick chat with the compressor guys, there doesn't seem to be a
way for nginx to know that the hashes have changed, so we may have to
be more cautious with caching those pages.