htaccess Long Expiry Headers

Home  »  htaccess Tools  »  htaccess Long Expiry Headers

Expires headers let your browser know whether to serve a cached version of the page and it's components or to download new versions of the files. By defining when a component of your site expires, you help to: Reduce server load.

Open up your .htaccess file in a text editor and paste in the following:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING ##