Overcome Leverage Browser Caching In WordPress
Is your site currently running slow, and you don’t know why it could be. There are many reasons for your site to be slow. The first thing you have to do is check the status of your website and get a full report from GTMetrix.
Below is an example of a website report. As you can see the Leverage browser cache is red. And that’s not ideal at all.
To overcome leverage browser caching in WordPress is quite easy, but before solving this problem, it’s good to know how Leverage Browser Caching actually processes with your web browser.
Read More: How To Backup WordPress Website Via cPanel
What is Leverage Browser Caching?
When a webmaster determines for himself how their website resources should appear in the reader’s browser. Whether it’s text data, images, scripts, CSS, or whatever the web page is serving. All processes performed by this webmaster take advantage of browser caching.
That means when a user visits a web page for the first time. All unchanged text data and images are cached or stored in their web browser.
By doing this, visitors will have a better user experience with your website because the website will load faster. Because browsers don’t have to load entire websites all the time.
How to Overcome Leverage Browser Caching
There are several ways to overcome the leverage of browser caching in WordPress, namely with caching plugins and via .htaccess. We’ll look at both of them here, and you can choose either one to increase your blog speed.
So, in this article, we are going to look at how to get rid of it and increase the page speed of your website.
How to Overcome Leverage Browser Caching Using .htaccess
This is one way of dealing with Leverage Browser Caching in WordPress without plugins. All we need to do is put a small part of the code in the root file in WordPress, namely access .htaccess. Leverage Browser Caching with Htaccess files is the easiest and most effective method you should learn.
Step 1. Login to your Cpanel Hosting.
Step 2. Locate File Manager and Click on it. This will open all the files of your WordPress site.
Step 3. Navigate to the public_html folder, and find the file called .htaccess from the right pane.
Step 4. Select .htaccess and right-click on it then select Edit. This will open a window, where you can add code for caching.
Note: We recommend backing up your .htaccess file before making any changes to make it safer.
Step 5. Scroll the file containing the code to the bottom and paste the code below at the end.
Do as shown below. How it should look in your .htaccess file.
Step 6. Press the Save Changes button, to save changes.
How to Overcome Leverage Browser Caching Using Plugins
To solve the browser caching leverage report in WordPress, we can take advantage of a caching plugin such as W3Total Cache. W3TC is one of the popular plugins and has great potential to increase page speed. So let’s get started.
Step 1. Activate and install the W3Total Cache plugin from your WordPress dashboard. 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, and now switch it to preview mode. So that the changes you make can be seen immediately before even saving the settings.
Step 3. Scroll down a little bit until you see Browser Cache and Enable it by checking the box.
Step 4. Click Save.
By enabling this option, you have enabled all browser cache options. And admin will configure it in the section below.
Now, we will add header caching. From the left pane in W3 Total Cache, select browser cache to enable some more cache options.
Check all options below in the General settings browser cache.
Set Last-Modified header
It contains the last modified date and time of the resource which is logged by the origin server. So enable it to make web pages load faster.
Set Expires header
Make sure this is checked, this is used to end most of the important header files. This will increase the browser cache of files.
Set Cache-Control Header
It is basically an HTTP header that really takes into account the time and the specific file type in the cache.
Set Entity Tag (E Tag)
This can allow the cache to work more efficiently, as it identifies a specific version of any resource. Enabling it can save bandwidth because the server doesn’t have to send a full response if the content isn’t changed at all. E Tag is much more effective.
Set W3 Total Cache Header
Setting up the W3 Total Cache header helps identify optimized files and performs faster loading.
Enable HTTP (gzip) compression
This is one important and often overlooked factor, enabling it will reduce the download time of the entire web page and all text files.
Now, even though the browser cache is enabled and all headers have been tuned. It’s time to set Expires header lifetime: (in seconds), so you want the browser cache to function.
To do that, scroll down a bit and make changes to all.
Set CSS and JS Expires Header Lifetime
Set HTML and XML Expires Header Lifetime
Set Media & other Files Expires Header Lifetime
Step 5: Click the Save button to make all changes take effect.
Now you have successfully configured W3Total Cache settings for Leverage browser caching in WordPress.
Now, you may want to check your website again for the difference in numbers. Most importantly, your readers will have a better browsing experience.
So that’s how to get around browser caching leverage in WordPress. If you don’t want to edit the .htaccess file for the same look for an alternative method. You can do this by using plugins.
With this, your page speed will increase. And this is an important part of SEO. One important ranking factor. Both the process through plugins and also from .htaccess work fine.
So many articles on the Best Ways to Overcome Leverage Browser Caching in WordPress. Look forward to other interesting articles and don’t forget to share this article with your friends. Thank you…
Mustafa Al Mahmud is the Founder and CEO of Blogger Concept and also a professional Blogger, SEO Professional as well as Entrepreneur. He loves to travel and enjoy his free moment with family members and friends.