Leverage Browser Caching
SEO

How to Leverage Browser Caching?

Leverage Browser Caching

Hi, today I will give you all the information that you need to know about leverage browser caching.

Leverage Browser Caching

It is a very simple and one of the best useful method to reduce load time of a website. Let me tell you how.

When a visitor visits a website first time then all the common files like CSS, images, JavaScript etc get saved in visitors local machine. Now whenever that visitor opens the same website again in future on the same machine, it loads more faster because some files are already there on the visitor’s local machine. So the browser doesn’t request those files from the server which helps to load the website more faster and reduce web page load time.

You just need to add the following code to your .htaccess file and make sure it is uploaded inside your website’s root directory.

## 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 ##

Thanks for visiting.

Author

I am a Full Stack Web Developer. I have more than 8 years of experience in the web design and development industry.

Leave a Reply

Your email address will not be published. Required fields are marked *