Simple Apache trick to increase Google Speed Test score

Google Speed Test will (unless set up) complain if you have not set up images to take use of browser caching. To get the browser to start caching static content you can add the following to your Apache vhost file:

ExpiresActive On
ExpiresByType image/gif "access plus 365 days"
ExpiresByType image/jpeg "access plus 365 days"
ExpiresByType image/png "access plus 365 days"
ExpiresByType image/bmp "access plus 365 days"
ExpiresByType image/png "access plus 365 days"
ExpiresByType text/css "access plus 365 days"
ExpiresByType text/x-js "access plus 365 days"
ExpiresByType application/x-javascript "access plus 365 days"

This entry was posted in Web development and tagged , , , . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">