What is Leverage browser caching and How to use them

What is Leverage browser caching and How to use themPin

Recently my friend checks his website in Google page speed test tool. It shows advice to make Leverage browser caching. I am new to web optimization. So what is Leverage browser caching and How to use them?
Need Advice.
Leverage browser caching to increase your website page loading speed. Every browser needs to load and render several things such as logos, images, CSS files, and JS files. Each page visit needs this same thing. But if you make Leverage browser caching, your browser remembers your webpage resource which is already loaded.
This means if your visitor goes to any other page on your website, the browser doesn’t need to get your website resources (CSS, JavaScript files, images, etc) again. So your website page load speed will be increased.
Login to your website C panel. Find your website directory and Add this code to your website .htaccess file. if you do not see any .htaccess file check your web hosting file manager settings. Sometimes it is hidden.

Code:
## 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 text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

If your friend already using any WordPress CMS, don’t need to go website C panel to edit .htaccess file.
There are many plugins available to edit the WordPress .htaccess file. One of the WordPress plugins is
WP htaccess ControlYou can easily edit the .htaccess file in your WordPress Admin dashboard.
Note:
https://developers.google.com/speed/docs/insights/LeverageBrowserCaching
https://developers.google.com/speed/docs/best-practices/caching
Use these links to get some detailed information about Leverage browser caching from Google.

About The Author

Scroll to Top
Share to...