Fortunately, there is a simple solution to this problem: Enable Leverage Browser Caching. Leverage browser caching can help you store some of the website data in users internet browser. This will load the website much faster on repeated visits.
Now let’s discuss how to set leverage browser caching on your website. There are two simple methods to do this: Through W3 Total Cache plugin and Editing .htaccess file. Here is a screenshot of digitap.net loading time prior to enabling leverage browser caching. Check the end of this article for a screenshot after enabling leverage browser cashing.
Method 1 – How to set leverage browser caching through W3 Total Cache Plugin
W3 Total Cache Plugin offers a simple method to enable leverage browser caching. Many WordPress websites, including digitap.net uses W3 Total Cache plugin. Follow the steps below.
Step 1 – Download and Install W3 Total Cache Plugin.
Step 2 – In WordPress Dashboard, navigate to Performance -> Browser Cache.
Step 3 – Set the parameters according to screenshot shown below. You can set these to your liking.
Step 4 – Hit Save All Settings. That’s it!
Method 2 – How to set leverage browser caching through .htaccess file
Step 1 – Access cPanel and go to Files.
Step 2 – Open .htaccess file in Editor.
Step 3 – Add the following code to .htaccess file and Save.
## EXPIRES CACHING ##
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
## EXPIRES CACHING ##
You can change the parameters to your liking in the code above.Depending on the nature of your website, you might need to increase the cache timing on certain fields.
Now let’s check our website (digitap.net) loading time after setting up leverage browser caching. In the screenshot below, you can see our website overall score increased to almost perfect! And website loading time increased about 10%. Although our website is a small blog with posts, this change could be massive for bigger websites. Let us know how much your website improved after enabling leverage browser caching in the comments section below.