How To Enable Browser Cache For Your Website

browser cache

What is a browser cache?

The browser cache also know as client-side caching is one of the caching technique that temporary store files downloaded by your browser to display websites in your computer. Files that are cached locally may contains various documents that renders to display as a website, such as html files, CSS style sheets, JavaScript scripts, as well as graphic images and other multimedia content.

Why do you require enabling browser cache to your website?

In today’s world time is a prime factor that controls our patient, if your website loads slower then you lose your customers. So to make your website faster caching is very important.

By placing the below code to your .htaccess file will instruct your browser to cache the files with duration information that is the validity of your file.

Enable Browser Caching

# Setup browser 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 5 months"
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 5 days"
</IfModule>

By Kalaiselvan

Kalaiselvan is an SEO expert who is passionate about building strategies that not only provide a great user experience but also drive revenue growth. He started in 2014, when he started building a WordPress SEO, site migration, and VPS server-side. He uses his experience in marketing, advertising, and customer service to create strong relationships not only with her clients but with their audience as well. Outside of working hours, I used to travel to the mountains, which gave me a peaceful mind.

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.