Viewing 1 replies (of 1 total)
  • I had trouble getting w3tc to leverage browser caching, so I disabled browser caching in the w3tc settings and added the following to my .htaccess file (this only works for Apache servers that allow mod_expires – I use Bluehost, and they allow it).

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>
    ## EXPIRES CACHING ##

    There is an explanation of what this does on the
    GMetrix site. Adding this to my .htaccess file increased my “Leverage browser caching” score on Google Page Speed from 14% to 100% and my overall score from 86% to 98%.

Viewing 1 replies (of 1 total)
  • The topic ‘how to sex expiry times for images (leverage browser caching)’ is closed to new replies.