How to Fix Leverage Browser Caching in WordPress For Speed

Have you observed a leverage browser caching warning while checking your page loading speed in a few online tools like GT Metrix and Pingdom?

The recommended modifications by these tools should be made to improve the page loading time.

Below is one of the website reports, for instance. As you can see, leverage browser caching is in red. And it is not ideal at all. Immediate action has to be taken to get it normal.

If you too got such kind of result and want to fix this error and boost the speed of your website, then read on. This article is definitely for you.

Leverage Browser Caching is the most common one as enabling it helps the visitor to have a better experience with the loading at their end.

A better page loading speed gives a better user experience. Though Google has announced page loading speed as one of its ranking factors. So it’s important to achieve and maintain a lightning-speed website.

So, in this article, we will see how to get rid of it and boost your website page speed.

There are a few ways to do it with caching plugins and also through the .htaccess. We will see both ways here, and you can choose either one of them to skyrocket the blog speed.

What is Leverage Browser Caching and how it works

When a webmaster self-defines how the resources of their website should perform on the reader’s browsers. Whether it could be text data, images, scripts, CSS, or any that is being served by a web page. This entire process performed by the webmaster leverages browser caching.

That means the user visits the web page for the first time. All the unchanged text data and images are cached, or stored in their web browser.

By doing this the visitor will have a better user experience going forward with your website as the website will load much faster. Because the browser doesn’t have to load the entire website every time.

Sounds cool? Let us get into action.

How to Leverage Browser Caching in WordPress

The process of browser caching in WordPress without a plugin is also quite easy. All we need to do is, drop a small piece of code in the root file in WordPress i.e .htaccess.

1. Leverage Browser caching via .htaccess

  • Step 1. Login to your Hosting Cpanel.
  • Step 2. Look for the File Manager and Click on it. This will open all the files of your WordPress website.
  • Step 3.  Navigate to the public_html folder, and find the file named .htaccess from the right pane.
  • Step 4. Select the .htaccess right-click on it and then select Code Edit. This will open a window, where you can add the code for caching.

Note: It’s wise to take a backup of the .hta access file before making any changes to it to be on the safer side.

  • Step 5. Scroll the window containing the code to the bottom and paste the below code at the end.
## Expires Header Caching ##

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"

## Expires Header Caching ##
  • Step 6. Hit the Save Changes button.

There you go, you are all done with the setup. And successfully added the leverage browser caching for your website.

Now the visitors will be able to see your site loads much faster than before. For testing the same, you can head over back to GTMetrix. A score of 70+is an ideal for any WordPress website.

You can also achieve a good page loading speed by leveraging browser caching using the W3TotalCache plugin.

2. Leverage Browser Caching in WordPress via Plugin

We will start with the W3 Total Cache plugin, one of the popular plugins that has immense potential to boost page speed. So let’s get into it.

Once done, you will be able to see a new option on the right side of the WP dashboard “W3 total cache.”

  • Step 2: Navigate to the General settings of it, now enable the preview mode. So that the changes you are doing can be seen live even before saving the settings.
  • Step 3. Scroll down a bit until you see Browser Cache > Enable it by checking the box.
  • Step 4. Click on Save.

By enabling these options, we have activated all the browser cache options.

Wrapping up

Conclusion: Page speed enhances the user experience. And this is one of the important parts of the SEO. One of the important ranking factors. Both the process through the plugin and also from .hta access works great.

This is only one of the tweaks to enhance the speed of the WordPress website. There are a few more steps to get the speed maintained. You can keep your WordPress database clean and also stop the post revision from WP-Config to get created or minimize the number.

I would love to hear from you about your experience with the same. And the difference it made to boost up your website speed altogether.

Is your site is going slow, and you are not able to figure out why it so?

There are plenty of reasons your site may load slowly, which is not good at all. The first thing you should do is check your website status and get a full report from GTMetrix.

Before solving this issue, it’s good to know how Leverage Browser Caching processes with your web browser.

Leave a Reply

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