Forum Moderators: open

Message Too Old, No Replies

Stupid Firefox won't stop caching my page!

Whoa! Not often people say "stupid" and "firefox"

         

Dabrowski

10:13 pm on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok, I'm writing my site. I make changes. I hit refresh. Nothing happens. I make more changes, refresh, nothing. I write w*nk w*nk w*nk all over the page, refresh, nothing.

Am now being sued for profanities. Only kidding. ;)

This is an issue IE occasionally threw at me, it would cache the page and not reload it from the server sometimes when you asked it to. But it has a setting to refresh the page 'on every visit' which stops it caching.

I assume FF is sometimes doing the same thing, but can't find a similar option anywhere.

Anyone else experienced this or similar?

jdMorgan

10:27 pm on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the Cache-control header returned by the server with your pages?

I recommend:
Cache-Control: "no-cache, must-revalidate"
for frequently-updated pages, along with a relatively-short Expires header.

If you're not setting the cache-control and expires headers on the server, then browsers will cache the page heuristically based on the time since Last-Modified, and you can't very well be mad at them for trying to save your bandwidth and give visitors quick page displays when they hit the "Back" button or return to your site after 15 minutes away.

If you are simply trying to see the new page, then hold down the "Shift" key and click the "Reload" icon in Firefox or other Mozilla-based browsers. Use Ctrl-Refresh in IE, or use Ctrl-F5 any browser.

Jim

[edited by: jdMorgan at 10:28 pm (utc) on May 21, 2007]

treeline

10:28 pm on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use clear private data to make sure it's not cached, or set it so nothing's cached under the privacy settings.

Based on your description, consider the [remote, I'm sure] possibility that you're forgetting to save the file, or forgetting to upload it, or even [I hate it when I do this] uploading it to a different directory than the original. If it's a temp file on your own computer, close the window forget refresh and start over. Should be fine. :)

Dabrowski

10:44 pm on May 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the Cache-control header returned by the server with your pages?

No idea, which is really bad as it's my server and I provide my own hosting!

I'm using IIS, found a "Content Expiration" option and set it to "expire immediately". That I imagine will have done that.

and you can't very well be mad at them for trying to save your bandwidth and give visitors quick page displays

Agreed, but no worries, this is a private development site.

If you are simply trying to see the new page, then hold down the "Shift" key and click the "Reload" icon in Firefox or other Mozilla-based browsers. Use Ctrl-Refresh in IE, or use Ctrl-F5 any browser

Yeh, tried that too. It only happens sometimes, I think it may have been a JS error. Nothing in the JS console, it was executing the old code that it must have cached. When the error was fixed it then refreshed correctly.

On my other FF installtion (on a VM), when I manually cleared the cache, the page refreshed and displayed the JS error.

Based on your description, consider the [remote, I'm sure] possibility that you're forgetting to save the file

LOL! Wouldn't be the first time!

forgetting to upload it, or even [I hate it when I do this] uploading it to a different directory than the original

Not an issue, as it's my own server I have direct filesystem access via the network shares, and as it's a development site, I just open and change the live files. Nobody else whould be looking at them anyway.

Setek

7:39 am on May 22, 2007 (gmt 0)

10+ Year Member



You could probably find an option to stop it from caching in
about:config
but that doesn't seem as useful for any of your users that might be encountering the same problem.

I have this meta in the head of every single one of my websites:

<meta http-equiv="Expires" content="Sat, 1 Jan 2000 08:00:00 GMT" />

... to determine the document as always expired, and requiring a modification check.

Works well enough for me, let us know if this fixes it for you :)

Dabrowski

10:46 am on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



useful for any of your users that might be encountering the same problem.

Again, it's a private development area. No users, or if there are they shouldn't be there.

I'll see if I get the same problems now I've changed the content expiration for the dev site on the server, problem is it only happens occasionally so I guess I won't know until it happens again.

Thanks for the advice

Fotiman

5:00 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



When it does happen, you might be able to force it to refresh by appending a query string. For example, if you page is located at:

http://example.com/

Then do this:

http://example.com?foo=bar

The querystring portion should force the reload I think.

Dabrowski

5:54 pm on May 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'll try that. Actually it happened again today, I changed some paths in a JS file, IE6, IE7 and FF2 noticed when I hit refresh. ad to clear the cache manually again to get FF1.5 to notice. Tried CTRL+Refresh too. It's really odd.