Forum Moderators: open

Message Too Old, No Replies

Browser Cache for File no Longer on Server

         

montman

11:46 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



There are occasions when I want to quickly check to see that a Web page I have on a server is still there. For example, if I think I may have accidently deleted it the last time I was connected to the server. So to save time, instead of checking for the file on the server, I just go to the url with my browser to see if it is still there.

I know that browsers compare the date and time of the file on the server with the date and time of the file in my browser cache, and if the date of the file on the server is not a later date, the browser uses the cached version rather than downloading the file from the server.

But if the file is no longer on the server, is it possible that the browser would bring up the file that is in my browser cache. leading me to believe mistaking believe it is still on the server? The seems very unlikely because if the browser is comparing dates, and the file is no longer on the server, there is no date to compare with. But i just want to be sure.

rocknbil

1:52 am on Feb 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No that's entirely possible, especially in I.E., but I've had troubles with older versions of FF too. And it can get worse if you're on a proxy server such as satellite.

Okay, the truth . . . as a developer it can be a nightmare. The page itself may clear from the cache, but often the CSS or JS hangs in there stubbornly.

Most of the time though, you can hold the CTRL (Apple for Mac) key in both browsers and hit F5 or the Reload/Refresh button. This forces the browser to download a new copy regardless of the information it is (sometimes incorrectly) getting from the server.

Beware though, sometimes a 404 or a 500 gets mishandled for whatever reason and STILL displays the cached version. I've seen it. Fortunately, not often and eventually goes away. I've no idea whether the cause is the browser or my ISP at the time, all I know is it drives me nuts when it happens.

And it gets really fun explaining that to a customer . . .

montman

4:54 am on Feb 8, 2010 (gmt 0)

10+ Year Member



Thank you for your response.

In Safari on my Mac, I tried holding down the Apple (command) key and hitting the refresh button--the whole url section just goes gray and nothing happens. But it sounds like even this method is not foolproof--even if I could get it to work.

So I guess the only way to be certain that the page is there, other than looking on the server to see that the file is still there, is to use the browser's tools to empty the cache. Then if I try to access the page again, and I see it, it must be coming from the server and not my browser cache. Am I correct?

tedster

5:36 am on Feb 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have set up a Google Webmaster Tools account, you can use the "Fetch as Googlebot" option.

montman

2:33 pm on Feb 8, 2010 (gmt 0)

10+ Year Member



Thanks for the suggestion of using "Fetch as Googlebot."

I'm still wondering, though, if I use the browser's tools to empty the cache, and try to access a page on the web right after that, and I don't get a page not found message, can be certain it is still on the server and not being displayed from the browser cache. In other words, can I be sure that manually emptying the cache does a complete job of emptying it.

rocknbil

7:16 pm on Feb 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it should, no, it doesn't always. Not in my experience anyway . . . I find "clear cache" and CTRL - F5 extremely unreliable. Sorry about the Mac command, it's been a while since I fired mine up. There should be an equivalent of force-reload, avoiding cache.

montman

8:05 pm on Feb 8, 2010 (gmt 0)

10+ Year Member



I found this in Safari Help:
"Safari: Reloading a page always bypasses cache
When you reload a Web page in Safari (by clicking the Reload icon or by pressing Command-R in Mac OS X or Ctrl-R in Safari Beta 3.x for Windows), cache files are bypassed. You don't need to hold Shift or any other modifier keys."
Apple thinks reloading the page always bypasses the cache, but maybe they are wrong.

tedster

9:33 pm on Feb 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The Web Developers Toolbar add-on for Firefox has something similar - "Disable cache". I never had a problem using it - what is on the server now is what you get.

montman

10:32 pm on Feb 8, 2010 (gmt 0)

10+ Year Member



Thank you tedster. I set that in Firefox to "Disable cache."