Forum Moderators: open
All satellite providers, to my knowledge, are proxy servers. It's just the way it works. For those that don't know, a proxy server caches it's own copies of files at the NOC, retrieving new ones only if it recognizes the source file has changed. Which it often doesn't.
I'll upload a change to a CSS external sheet. Delete private data (clear FF cache.) Reload the page. Usually, the changes take effect.
But here's what's annoying: refresh the page, and often the OLD style sheet will come back, even though the cache was cleared. Sometimes I'll get it updated, then begin working on content, changing only the page, not the CSS. Two or three refreshes in, the style sheet from before refreshing kicks in. Maddening.
Doesn't appear to happen in IE, oddly enough. So now I have to do a filename change with every update: filea.css, fileb.css, filec.css, to guarantee it updates during development. And even then, as mentioned, one of the old ones will take effect.
Anyone else have this kind of oddity? Is there some method to force proxy servers to do what I tell them to? :-)
Generally, if you set Cache-Control: "no-cache, must-revalidate"
you won't see this kind of problem.
(Note that "no-cache" doesn't mean "don't cache" -- It has suffered from "definition drift" over time. In order to stop caching, you now must use "no-store." So the above code usually will result in 304-Not Modified responses if you have not updated the page, and then only if the browser actually sends a request.)
Also take a look at your "Expires" settings to be sure you're not setting some over-long expiry time -- or worse yet, not setting one at all (which leaves it up to the browser and/or intervening caching proxies to decide).
I'll guess that your ISP uses multiple load-shared caching proxies, and that you may be getting a different one after two or three page reloads. You might also look into disabling "public" (proxy) caching and allowing only "private" (browser) caching in your Cache-Control header.
These cache-control and expires settings vary widely, and there is no "best answer" -- But you might want to experiment to see where the stale cached data is coming from, and what point on the freshness vs. server load curve makes you most comfortable.
Jim
One easy way of doing this I've come across recently is to add a query string onto the
link declaration which adds a datestamp, so when the CSS file datestamp changes, the browser sees it as a new filename. eg. in PHP: $cssfiletime = filemtime(dirname(__FILE__) . '/server/root/path/css/style.css');
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/mystyle.css?$cssfiletime\">\n";