Leverage Browser Caching in WordPress
In order to Leverage Browser Caching WordPress, your web server (where your website is hosted) should allow web browser to store visited webpages data temporally on local disk. This is how you will notice a significant improvement in your website loading speed.
To enable it, you need to set content expiry dates by adding Cache-Control and ETag headers in HTTP headers. Cache-Control states about the caching period of a particular file by web browser and Etag is used to verify changes in cached resources and requested resources.
We can set a specific period in months or years to keep cache resources (i.e. HTML, CSS or JS files, images etc.) locally. It is advisable to set expiry dates as per the frequency of changes in resources.
There are two methods to Leverage Browser Caching in WordPress-
– by adding a piece of code in .htaccess file hosted on your server (Apache)
– by using a WordPress plugin.
Leverage Browser Caching via htaccess Apache Server
You need to edit your WordPress .htaccess file.
Open the .htaccess file and paste the following code:
Leverage Browser Caching WordPress plugin
Download the ‘WP Fastest Cache’ WordPress Plugin via visiting this link.
Activate the plugin.
You will find a new link in side bar of WordPress Dashboard. Go to the plugin settings.
Check on the Browser Caching box as shown in picture and click on Submit button. A massage will be displayed “Options have been saved”, and you are done.
15th August 2017
24th November 2016