website Load Speed

How to Add Expires Headers on Website and Enhance Load Speed?

Create a .htaccess file with following lines and upload to your website root folder.

ExpiresActive on

# Your document html
ExpiresByType text/html "access plus 0 seconds"

# Media: images, video, audio
ExpiresByType audio/ogg "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 video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"

# CSS and JavaScript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"

Check using Yslow or Google’s PageSpeed Insights.

One Comment:

Leave a Reply

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