Tips To Leverage Browser Caching In Wordpress

Tips To Leverage Browser Caching In Wordpress

If you have a website in WordPress and you want to leverage browser caching, you must follow some simple tips. Simply if you leverage browser caching, your website loading speed will automatically increase. Page speed is crucial for the website. If your website takes too much time to load, it’s bad effect on bounce rate, it goes high.

What is the Browser Caching?
When the web page displays in your browser, it uses many resources such as HTML, CSS, JavaScript, graphic images and other resources in order to display pages. Browser caching is just a temporary storage in your browser and data in temporary storage is called cache.
When you surf on the internet or visit the website or web page, that time web browser saves data of that website in temporary storage. In this way, cache helps to decrease server loads, usages of bandwidth etc. That’s why leverage browser caching is beneficial to load your website faster.

How does it work?
It is very crucial to know how browser caching works so it will assist for your better result. Browser caching works by creating pages, or some parts of pages. Using the web server instruct the browser to save these files and do not download them up to when you come back your users time and your web server bandwidth.

How to Leverage Browser Caching in WordPress?
You can leverage browser caching via .htaccess file or through WP Fastest Cache WordPress plugin. If you choose .htaccess option, you simply need to type a code in your .htaccess file on the server.

Here is the code:
# TN Expires Caching Start #
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresDefault "access 1 month"
</IfModule>
# TN Expires Caching End #
If you take the second option, you need to download WP Fastest Cache WordPress plugin. Then install and activate the plugin, then you will get the new link in your WordPress Dashboard, you need to go plugin settings where Browser Caching box has shown and just click on the submit button.
Leverage Browser Caching for Images, CSS and JS.
Here get the correct information for leverage your browser's caching means specify how long browsers should keep images, CSS and JS stored locally. If anyone wants perfect result they must follow all the rules and regulation which is very crucial for WordPress. If you make any changes, then the server will inform the browser of visitors to clear that cache first. To enable it, and here .htaccess file will be as given:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
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"
</IfModule>
## EXPIRES CACHING ##
Author
bhawanisingh
Views
1,805
First release
Last update
Rating
0.00 star(s) 0 ratings
Top