Ajax vs Caching vs Firefox 3
Wednesday, July 30th, 2008In an earlier post, many moons ago, I related some struggles with Ajax page updates and browser caching behaviour. Today I have had to revisit the same problem again, thanks to Firefox 3.
The good news is that this time it was very easy to spot via the “Net” tab of Firebug. I could clearly see that no request was being made when I expected an Ajax-based panel update. I could also see that the response headers on the previous request for the same panel, whilst including some Cache-Control parameters, didn’t seem to include every header I expected. A bit of searching around led me to a useful comment on a Mozilla bug report. The bug report suggests there may be some issues when specifying multiple Cache-Control headers, with a specific header ordering to fix the problem. So I updated the headers set to:
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
So far this update appears to work: at the very least it solves the panel update problem I was seeing. Hopefully it can save someone else wasted debugging time!