November 12, 2005

Safari caching problem

I've switched back to Safari from Firefox, as Firefox was just running too slow for me. I have one major problem with Safari though - it seems to be really bad at noticing changes in pages, and is caching too heavily. Is there any way I can reliably tell Safari to insist on downloading a page from scratch? Posted by savs at November 12, 2005 11:49 PM
Comments

Short answer: there isnt a reliable way of preventing caching

Long answer: this seems to be the best you can do (php style)

// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");

Posted by: tom at November 13, 2005 9:31 AM

I've been doing the following:

wget -q -Y off -C off --delete-after http://url

... which seems to force all the caches between me and the site I want to view to update, so Safari then behaves. It's tedious and annoying though, since Firefox behaves better.

I've not really though much about the implications, but my guess is maybe Safari is also doing 'the right thing' by obeying what the caches are telling it; maybe it's NTL's cache that is at fault by not checking for fresh content properly. In which case the fix for Safari would be bouncing off a non-caching proxy outside of NTL, I guess. Hrm... :-(

Posted by: Andrew Savory at November 13, 2005 10:13 AM

Well, if you select Private Browsing from the file menu AFAIR that turns off caching.. Sounds a bit extreme though.

Posted by: Adrian Bool at November 13, 2005 1:12 PM

Same here. I am really wondering what made Firefox so much slower. Now I am pretty happy with Safari - haven't noticed the caching problem yet though ...but you always have to keep Firefox as a backup as there are few sites that still just don't work with Safari.

Posted by: Torsten Curdt at November 13, 2005 1:34 PM