On WordPress the most first thing we have to do is optimize the speed and make our blog user friendly so that it can also be accessed via slow internet connection. For finding where our site lags, we also uses some tools like Google Pagespeed, GTmetrix, Pingdom etc. You can read our full WordPress Optimization Guide. But here we are just going to see how to enable leverage browser caching in WordPress.
Leverage Browser Caching in WordPress
- The first step is to find your .htaccess file which is located in the root directory of your WordPress installation.
- Take a backup of your .htaccess file, in case something goes wrong you can replace the file to keep everything working.
- Open up .htaccess file.
- First thing that you need to do is to get rid of Etag. This is because after disabling Etag, browser needs to rely on cache-control and expires header that is defined by you. For doing so add the following code to your .htaccess file:123Header unset PragmaFileETag NoneHeader unset ETag
- Now save your .htaccess file.
So that’s it you have successfully added Leverage Browser Caching to your WordPress site. You can check whether this worked or not by using various speed test sites(Some we mentioned earlier in the beginning).
Thank you for reading this post and keep connected to Tech Arrival to continue enjoying wonderful posts. Share your views about this post in comment section below. If you are still having any query throw it in comment section.
If you find this post helpful, don’t hesitate to share this post on your social network. It will only take a moment and also it is quite easy and helpful for others.