How to Speed Up WebSites with htaccess Caching

Published on Author Code Father

Awesome ways to implement caching on your website using Apache .htaccess (httpd.conf) files on the Apache Web Server. Both methods are extremely simple to set up and will dramatically speed up your site!

Apache .htaccess Caching Code:

# BEGIN EXPIRES

<IfModule mod_expires.c>

ExpiresActive On

ExpiresDefault “access plus 10 days”

ExpiresByType text/css “access plus 1 week”

ExpiresByType text/plain “access plus 1 month”

ExpiresByType image/gif “access plus 1 month”

ExpiresByType image/png “access plus 1 month”

ExpiresByType image/jpeg “access plus 1 month”

ExpiresByType application/x-javascript “access plus 1 month”

ExpiresByType application/javascript “access plus 1 week”

ExpiresByType application/x-icon “access plus 1 year”

</IfModule>

# END EXPIRES

Comments

comments