Setting Expires header in .htaccess to improve your page load time
- Created: Saturday, 12 January 2013 14:10
- Last Updated: Saturday, 25 January 2014 18:57
- Hits: 1984
If you check the performance of your site using any of the site speed analyser like page insights, you can find the most important suggestion they will be giving would be to set Expires header so that the browser can use the cached copy. You can set the expires header for your site with a few lines of configuration in .htaccess file.
Pre-requisites : mod_expires.c should be enabled
in your server. Most of the hosting services will have made this enabled. To set an expires header to your static files, add the below code to your .haccess.
ExpiresDefault "access plus 1 year"
If you analyse your site using the tools again, you can see the expires header set.