What is leverage browser caching ?
Leverage browser caching is to make your webpages load faster. As Google starts considering site speed as a SEO parameter,webmasters can leverage browser caching to improve site speed and get better search engine rankings.To leverage your browser’s caching generally means that you can specify how long browsers should keep images, CSS and JS stored locally. Of course, if you change any of those, the server will tell the visitor’s browser to clear that cache.
leverage browser cache Setup and Code
- Login into your cpanel
- Open to File Manager
- Go to path “public_html/www”
- The code below should be added to your .htaccess file
# START Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css “access plus 1 month”
ExpiresByType text/javascript “access plus 1 month”
ExpiresByType text/html “access plus 1 month”
ExpiresByType application/javascript “access plus 1 month”
ExpiresByType application/x-javascript “access plus 1 month”
ExpiresByType application/xhtml-xml “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 month”
</IfModule>
# END Caching