2

I've included the following section in my htaccess file. However I still get an error for 3 js files when I run Google PageSpeed Insights. The reason may be obvious but I can't see it. Donald

# BEGIN Expire headers

ExpiresActive On
ExpiresDefault "access plus 1 week"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
**ExpiresByType text/javascript "access plus 604800 seconds"**
ExpiresByType application/x-javascript "access plus 604800 seconds"
ExpiresByType text/html "access plus 604800 seconds"
ExpiresByType application/xhtml+xml "access plus 1200 seconds"

# END Expire headers

Leverage browser caching for the following cacheable resources:

https://apis.google.com/js/plusone.js?onload=onLoadCallback (30 minutes)
http://google-analytics.com/ga.js (2 hours)
http://www.google-analytics.com/analytics.js (2 hours)

Is it possible that the particular file paths in the htaccess file are to blame? i.e. in one line I have text/javascript and in another I have application/x-javascript. Do I need to double up on those?

Donald
  • 21
  • 2
  • I also have this question but I am working in IIS 7. I have configured IIS with the appropriate expires header but the http://google-analytics.com/ga.js file still gets flagged by PageSpeed Insights. Is there any good way to stop getting flagged while still using this file? – RacerNerd Sep 03 '14 at 23:19
  • I ended up serving all css and js files from my server rather than cdn. Got 100/100 on page speed with that approach :) – electronix384128 Nov 18 '14 at 03:45

0 Answers0