Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Leverage browser caching to speed up website loading

Browser caching is an important factor to load your website quickly. If you test your website using online speed test tools like Google PageSpeed, you will get a message stating that you should Leverage Browser Caching for some static contents to speed up website loading.

It is recommended you set appropriate cache expiry for your static contents. In this article, we will provide you the code to enable expiry for your static contents using .htaccess.

Your hosting server must support required caching module to use the following rules:

ExpiresActive on
ExpiresByType text/css "access plus 14 days"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType text/javascript "access plus 14 days"
ExpiresByType application/x-javascript "access plus 14 days"
ExpiresByType image/ico "access plus 14 days"
ExpiresByType image/jpg "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType text/html "access plus 14 days"

You can add other required static contents in the above list (i.e video files etc.).



This post first appeared on Web Hosting Blog - Web Hosting Discussion, please read the originial post: here

Share the post

Leverage browser caching to speed up website loading

×

Subscribe to Web Hosting Blog - Web Hosting Discussion

Get updates delivered right to your inbox!

Thank you for your subscription

×