What does the error LEVERAGE BROWSER CACHING mean?
When you are trying to speed up your site, you may have used a few of the great FREE tools that are out there. I use Pingdom and Google PageSpeed tools. When these tools detect a problem with browser caching, you will see the error “Leverage Browser caching”. To explain what this means I will start with the definition of caching. You can read the full definition here https://en.oxforddictionaries.com/definition/cache.
“1.2. Computing: An auxiliary memory from which high-speed retrieval is possible. as modifier ‘typical cache sizes range from 64K to 256K’ “
A cache is a place where files are stored.
A browser cache is a place in your browser (e.g Firfox / Chrome) where website files are stored for quick retrieval. If the files are stored in the browser, the browser doesn’t have to go and fetch your files each time. This speeds up your pages loading time considerably.
If you set up your website to leverage browser caching, then you are telling the browser to store your website’s files for a certain amount of time. Once that time has passed the browser knows to go and look for a new version of the file.
The problem with browser caching
Google recommends you cache files for one week. However, if you have a page that is being updated more often, e.g a blog home page where you are adding articles daily, then you may want to specify a shorter time for your home page.
So before you start caching pages you need to know which pages change often, and how often, so you can set the caching rate accordingly.
Do you need to leverage browser caching to help you speed up your site?
You may have already checked your site through Google’s PageSpeed tool. If not, and you have never heard of the PageSpeed tool, here is the link. https://developers.google.com/speed/pagespeed/insights
This tool highlights any problem your site has that may be slowing it down. If you want to know why a slow site is bad for business read this article here -> What is page speed and why should you care?
So back to the PageSpeed tool. If you have put your web page URL in and you see the error “Leverage Browser Caching” – it looks like this ->
When you click on the Show how to fix link you will be shown a list of files whose caching time you can increase to speed up your site.
Before caching my site looked like this in Google PageSpeed;
Google gave me 80 / 100 for my desktop performance and I had 12 files to cache.
Before caching my site looked like this in Pingdom;
And I had a suggestion telling me to cache all these files.
14 files were to be cached.
If your page is loading in less than 3 seconds and you have a bunch of files show up in the Leverage Browser Caching tab, then you do need to leverage your browser caching.
So, I’m sure now you want to know;
How do you leverage browser caching?
It depends on your website platform. I use WordPress and have been a developer for over 7 years. I will tell you how to do it in WordPress.
You download the plugin called WP Rocket. This is a premium plugin, however, anyone taking my speed up service will have it installed for free as a bonus.
The beauty with WP Rocket is that you don’t need to configure it. It works out of the box. Some other free plugins are complicated and still don’t work as well as WP Rocket even after you have spent a while configuring them.
How my site looked after leveraging browser caching using WP Rocket.
How my site looked in Google PageSpeed;
My score jumped up from 80 to 83 and I now only have 5 files to cache. These files are external files from Facebook and Google so I can’t control the caching of these, so, for the time being, I will stop here. One day I could look into storing a local copy of those files, but I’m happy with the result so far.
How my site looked in Pingdom;
My performance grade has gone from D64 to C76 and the speed has increased by 200mS. The requests have gone down also.
Not bad for one plugin and 5 minutes worth of work.
So that’s leveraging browser caching ticked off the problems list.
I’m going to see what I can fix next… stay tuned…
SHARING IS CARING
If you have enjoyed this article and found value in it, please consider sharing it with someone who would benefit it. Not only will it help them but it will help me too. Thank you.