Candid’s brain

Firefox caching behaviour

As I have posted before, I am trying to implement a proper If-Modified-Since handling to some web page. A problem I had to manage was that you could log in on that page, which caused the user to have to reload the page in order to be logged in, as the browser correctly used the cached not-logged-in version. I wanted to solve this problem by always sending the current time stamp as Last-Modified header, and thus never sending a 304 Not Modified (the fact that logged-in users cannot use the cache then is acceptable, as the number of user accounts is quite limited). Firefox did not like that solution, it kept using the cached page without checking if it had changed (wheres in Opera everything worked fine).

What I wanted to achieve Firefox to do exactly was only to use the cache if it received a 304 Not Modified status. As I could not find out anything detailed about this on the Internet, I tried several combinations of HTTP headers, such as Cache-Control: must-revalidate, which did not have any effect. The working solution was simple but not easy to find: Expires: 0.

Filed under bugs

Comments are closed.