There are a multitude of articles out there on browser caching. If you're using Apache as your web server and want to cut to the chase – implement browser caching on your static content (images, css, javascript) by dropping the code below into your httpd.conf or VirtualHost stanza:

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css A2592000
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript A2592000

This will instruct browsers to cache gif, png, jpeg, css and JavaScript content for 30 days.

If you want to understand more, check out the following articles:

Leverage Browser Caching

Caching Tutorial

Tags:

Leave a Reply

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