Weblog entry #64 for simonw

Browser caching sucks
Posted by simonw on Mon 17 Jul 2006 at 12:51
Tags: none.
Browsers are notorious for caching DNS RR too long. You can fix that one with a Squid cache behind the browser, amazing what free software can fix.

Friday I was struggling with a fairly simple Apache config file, but whatever I tried, nothing seemed to work. I then backed out my last change, and noticed this made no difference to the resulting behaviour.

My experimenting had been trounced by Firefox's browser cache. This morning I revisited it a bit more awake. One case I saw is if I have an alias "Alias / /somewhere/file.ext" and ".ext" isn't mapped to a handler, then I get the file for download in Firefox (fair enough). Now whatever I do in Apache, firefox continued to supply this file for saving to disk, including deleting all reference to this file and alias in the Apache config, restarting Apache, restarting Firefox, you need to explicitly clear the disk cache in Firefox to persuade it to realise the cached data is now stale.

For a long time when I was using Firefox at home I had caching disabled by accident, and I never really noticed, I think I'm going to deliberately disable it here now. I don't believe everyone else tests stuff with "wget", so what do you guys do to sort browser caching problems?

 

Comments on this Entry

Posted by Anonymous (213.164.xx.xx) on Mon 17 Jul 2006 at 13:46
I test with lynx, turn caching off, install the live headers extension to watch what it's doing, or try to invalidate the cache with ctrl+shift+reload.

[ Parent | Reply to this comment ]

Posted by ido50 (89.1.xx.xx) on Mon 17 Jul 2006 at 13:52
[ Send Message | View Weblogs ]
How can I do that with Squid?

[ Parent | Reply to this comment ]

Posted by simonw (212.24.xx.xx) on Mon 17 Jul 2006 at 14:50
[ Send Message | View Weblogs ]
Squid honours TTL, the browsers (IE and Firefox) will query squid, so the TTL is honoured. In this config the browsers don't do any DNS lookups (of course it may be caching the Squid servers TTL for longer than it should - sigh) so don't cache them for too long.

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search