I added the following code to an htaccess file:
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month”
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
but these changes are not reflected by Google's PageSpeed and the YSlow Addon for Chrome.
Based on the above code, can someone explain why I continue to receive an F grade for expires headers for PageSpeed and YSlow? More importantly, why does Google's PageSpeed indicate that the defined filetypes expire in 4 hours instead of the 1 month as defined in the htaccess file?
Here are my response headers:
Date: Wed, 17 Oct 2012 15:29:36 GMT
Content-Type: text/html
Server: Nginx / Varnish
X-Powered-By: PHP/5.2.17
Cache-Control: max-age=2592000
Expires: Fri, 16 Nov 2012 15:29:36 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Age: 0
200 OK