Solution: How to Leverage browser caching to Improve Page Speed Score?
I was looking to improve my page speed score for one of my client website. Previously score was 92/100. I was getting a warning from Google Page Speed Tool:
"The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:..."
I search google and found an easy way to solve this issue.
Put this code into your .htaccess file and upload it:
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$"> <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 30 days" </IfModule> Header unset ETag FileETag None </FilesMatch>
Now, wait few mins, and recheck your Google Page Speed Score. You will see your Page Speed Score will be improved. My Google Page Speed Score improved and jumped to 98/100.
Please note: I have tested the above code on GoDaddy Hosting and it was working absolutely fine.
If you like this post you can start following me on twitter