What is a Browser Cache, and Why is it Important?

We have all heard about a cache, usually in terms of things like a secret cache of weapons. It means placing things in storage of something that may be useful in the future. That is exactly what a browser cache is, but it stores website assets. When you visit a website, the browser takes parts of that page and stores them on your computer’s hard drive. This can include things like images, logos, pictures, HTML, and other code from that page. Basically, parts of the page that do not usually change from one site visit to the next. This is done so that when you return to the page, these stored assets do not have to be downloaded for you to see them; they get called from your hard drive. Depending on your browser and its settings, this could be stored for up to a year.

The benefits of caching

When you go to a website for the first time your computer communicates with the server hosting the website. The HTML is downloaded; this is the framework for the display of the website. The browser then requests the assets mentioned previously. Depending on the speed of the site, the server it resides on, the bandwidth available, as well as your computer and internet connection, the page will load. Some pages load very quickly if there are fewer assets, or if the page has been optimized well by the developer, but others may load more slowly. For example, text will load rather quickly, but a high-quality image may load more slowly.

Caching speeds up browsing. Once the assets are downloaded, they reside on your hard drive for a while. Pulling the assets from your hard drive is faster than over the Internet, regardless of the speed of your Internet connection.

Let’s consider a typical eCommerce website. Some assets, like the logo, appear on every page in the same location regardless of where you are on the site. Without caching, your device would have to download the logo every time you click on another product page.

Additionally, large images, JavaScript files (used to run applications like the shopping cart, interactive images, and calculators) are stored in your cache. If a visitor had to wait 5 seconds or more for a “Buy Now” button to appear your conversion rates would plummet. In fact, if they have to wait 5 seconds for your page to be displayed it would likely cause them to bounce to another site. A fast, fluid browsing experience is absolutely necessary for visitors to feel comfortable on your site and to convert them to customers. When they return to your site the assets stored in their cache will make your site load even faster.

Additionally, those browsing on mobile devices will use less of the data allowance because less has to be downloaded once cached.

Some of the problems with caching

So, you decide that your logo needs to be updated because you want to change the color. So, you have your developer update it. But now you go to see how it looks and the old logo is still there. Assuming the change was done properly, the issue is likely your cache. This is not something your developer has control over.

Your browser has a cached version of your logo on the hard drive. Because of this, it does not request a new download of the image. As a result of caching your browser will not obtain the new logo until the cache file expires.

Older cached versions of files cause all sorts of issues for users.  If their devices don't have the latest version of the file - mismatched formatting, broken JavaScript, and incorrect images are just a few.

guy on tablet

For the most part, this doesn't happen because the server knows which assets have been updated and need to be replaced on the user's machine. However, if one of your customers complains that the site is broken for them and no one else, then you should advise them to clear their browser cache. This also happens when a new website is launched, replacing your old one. Some visitors may see the old site, even though your developer has indicated that the new site is live. Again, this is out of their control.

Some browsers make it easier than others to clear the cache, but all of the major browsers have a “clear cache” function. Using that function erases all of your cached files. Give it a try. Go to a page that you visit often and take note of the load time. Now, clear your cache and visit the page again. You will notice it will load slower.

We have put together some instructions for clearing your cache on different browsers, which can be found here.