The-Write-Guy

How to Leverage Browser Caching in WordPress

How to Leverage Browser Caching in Wordpress

Hi Readers,

As we all know, getting a high ranking on Google Search is extremely important if you want website visitors. The speed of your website greatly affects your rankings on Google. And that is why there is a lot of fine-tuning you have to do to your website to achieve that. So if you are not interested in ranking high on Google, then I’ll let you know right away that you are reading the wrong article. I have written an article on how to celebrate St. Patrick’s day in Dublin and it’s totes amazeballs, you can read it here. :).

Jokes aside, we have already looked at How to Optimise Images in WordPress and How to Minify HTML/CSS. If you haven’t read these, please click the above links and learn the importance of doing these for your website. Today, we are going to look at how to leverage browser caching to increase website performance.

With Browser Caching, you can tell browsers (Google, Internet Explorer, etc.) How to Leverage Browser Caching in WordPresswhen your files usually change. For example; every month, every week, etc. This will make your website faster because the browser will only make requests to your server after the declared time. PageSpeed is a Google Ranking Factor so it is important to have a fast website. Slow websites only push you further down the pecking order, and fewer website visitors also means fewer conversions.

 

To see if your website’s caching needs to be regulated, Google has created PageSpeed Insights in order for you to find that out. All you have to do is type in the name of your website and click ‘Analyse’. The analyser will then give your website performance a percentage rating on both desktop and phone devices.

If you do not have a high rating, Google PageSpeed Insights usually classifies the problems under any one of four of the below headings:

How to Leverage Browser Caching in WordPress

 

NOTE: Not even Google.com has 100% website functionality on PageSpeed Insights, so your target should be 85% and above.

The fourth tick is what we are interested in today. If you click on the ‘Show how to fix’ button’, you will see a pop-down code similar to the one below:

How to Leverage Browser Caching in WordPress

 

 

 

 

 

 

 

 

 

 

and so on…

The second line means that css files will be requested after 30 minutes. The third line means that javascript files will be requested after 30 minutes and so on. Your objective here is to make sure your browser does NOT request these files very often, because it reduces your website speed and therfore affects your ranking on Google.

So to leverage caching, you want to increase these request times from say 30 minutes to 1 month, or preferably 1 year. The choice is up to you. And now to the important stuff;

How To Leverage Browser Caching in WP.

There are several lengthy videos and articles on how to change this code, but if you are a WordPress user then you are in luck. All I needed to do was go to the ‘Plugins’ section on my Dashboard and download a plugin called WP Fastest Cache.  Once that is done, simply activate the plugin and check all the boxes as instructed in minute 4:00 in the video below.

Once that is done, hit the ‘Submit’ button and everything will be done for you automatically. Now, rerun your website in PageSpeed Insights. Hopefully, the analyser will give you a higher performance percentage and clear most of your caching issues. And that brings us to the end of this article 🙂

I hope this article was of help to you. If you did like it or have any constructive criticism, please leave a comment, share and stay updated for more content like this.

Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *