Understanding browser caching
It's mid-morning. You sit down at the computer, fire up your Internet browser, and visit your favorite web site. Oddly, you discover that last week's content is still being displayed. So, you phone your buddy across town, who claims their computer is showing recent content from this week. You may ask, what gives?
This kind of thing happens quite frequently, actually. As webmaster of the Sun Advocate and Emery County Progress web sites, I often get calls from online readers who are seeing old content, thinking we haven't recently updated our web site.
I have to explain to them that the content has, in fact, been updated and then proceed to explain to them what to do to fix the problem.
To understand the cause of the problem, you have to understand a little bit about browser caching. Browser caching is a process that involves holding onto recently viewed information for a certain period of time just in case it is needed again.
Internet browsers, like Mozilla Firefox, Internet Explorer and Opera all contain a browser cache that contains all the contents of web sites the user has visited recently.
But why would a browser do such a thing? Because in most cases Internet bandwidth (interpreted by you as download speed) comes at a premium.
So when a user visits a site and then decides they want to go back to the page before, for example, the browser generally loads the site from it's cache rather than re-downloading the website like it did in the first place. Why re-download content that was just viewed minutes or even seconds before?
Another purpose for browser cache is offline support. This means you can load a site you've just viewed even though your Internet connection has since been turned off or disabled. Such a feature was very handy back when dial-up was the mainstream way of getting online.
The problem is, sometimes the browser incorrectly loads the site from cache instead of loading it like normal. So the user thinks he or she is viewing the actual site, when in fact they are looking at an old copy the computer has been holding onto for some time.
The solution? In virtually all modern Internet browsers, you simply need to hold the Shift key and click the reload or refresh button; or, alternatively, press Shift+F5.
Doing so will force the browser to load the site like normal, thereby downloading and displaying the site contents directly from the site itself.
Have comments about this article or suggestions for a future Tech Tips article? Send an e-mail to firstname.lastname@example.org.