What is Browser Caching
December 31. 2019
You’ve most likely heard of the word cache before, but you are probably not too familiar with its meaning. In layman’s terms, caching means placing something in storage in hopes that it will become useful later on. And that’s what browser caching (or web caching) is, and it’s done with the help of a program and website assets. Every time you visit a page online, your browser takes pieces of those pages and stores them on your hard drive. Our WP Full Care experts are about to explain everything you need to know about web caching, including its benefits, but also its pitfalls. So stay tuned and get answers to your caching questions once and for all.
Details about browser caching
Web caching is a technique through which data is temporarily stored on your computer. But not every piece of data will be a storable material. Usually, browsers store something that’s known as ‘static assets.’ These are parts of a website that don’t change with every visit, and they can include:
Now, what gets cached and for how long it remains depends on the website. Some assets can get removed from your machine within days, while others will linger for quite some time. However, a lot of people are led by the thought that it can’t possibly be a good thing that other websites are storing assets on your hard drive without your permission and knowledge. And we have to agree that the concern does seem legitimate. However, there is a reason why the browser cache exists. True, like everything else, it comes with its fair share of pros and cons. But we are much more inclined to believe that its benefits by far outweigh the risks.
The good side of the coin
In order to understand the benefits of caching, you first need to understand the process that precedes it. The first time you visit a website and open a page or a post, your browser comes into contact with the remote server that hosts that website. The process of loading a page works by your browser sending requests after which the server sends back one of the website’s assets. If you are trying to load a high-impact landing page that has a lot of assets, you have to be prepared for the fact that it’s going to take a lot of time.
To demonstrate what we mean by this, try and remember whether there was a time when a page was loading and the first thing you saw was text which was followed by images. That’s because pieces of text are small in size whereas images can take seconds to load which, in website time, equals ages. Today, having a fast-loading website is one of the ultimate goals for many website owners, and rightfully so!
From a website visitor’s perspective
But back to the issue at hand. What gets achieved with caching is improved browsing speed. Once an asset is downloaded on your computer, it will stay there for a period of time. Let’s say you are viewing an e-commerce site at the moment. You are clicking on a product page after a product page, searching for your perfect match. Once the logo or other ‘static assets’ get stored on your machine, they won’t have to be loaded every time you click on a new page. And don’t worry – you don’t have to make all of your purchases right away. This data will be stored on your computer for some time and you can go back to the website in the foreseeable future without having to wait for it to load these assets over and over again.
From a website owner’s perspective
The pitfalls of browser caching
If you have enabled asset caching for your website and you decide to make a change, you might not be able to. Let’s take a logo change as an example. You try to change its color or features but you click on your website and see that there are no changes. This happens because your machine has a cached version saved on your hard drive. It won’t bother sending a request for an image download – it will use the cached one. And this little problem will be present until the cached version of the previous logo expires.
If browser caching is giving you headaches, then you have a simple solution at hand. And it’s the one that all major browsers have – the ‘clear cache’ button. This will erase all of the stored assets and you will have a fresh start. If you do opt for this option, why not conduct a little experiment of your own? Visit a page after you have cleared your cache and note how long it takes for it to load. Now close the page and try loading it again. We are sure you will see the difference. Finally, know that you can clear your cache for only some of the websites. That means that if only one is giving you trouble, you can focus all of your efforts on it.