WebPagetest Forums
Expires Headers + google-analytics.com/ga.js - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Optimization Discussions (/forumdisplay.php?fid=5)
+--- Thread: Expires Headers + google-analytics.com/ga.js (/showthread.php?tid=12405)



Expires Headers + google-analytics.com/ga.js - GHLSports.com - 07-15-2013 05:15 PM

I get %89 score on my page http://www.ghlsports.com/, in the Expires Headers section with this comment

There is 1 static component without a far-future expiration date.

http://www.google-analytics.com/ga.js


Is their a method to fix this, I found this article

http://www.ehow.com/how_12179302_add-expired-header-google-analytics.html

Is this a good idea / bad idea any other recommendations


RE: Expires Headers + google-analytics.com/ga.js - pmeenan - 07-16-2013 11:35 PM

Don't do it. Google Analytics is used across so much of the web that it is almost guaranteed to be in a user's cache even with a short expires.


RE: Expires Headers + google-analytics.com/ga.js - mrPerezMarc - 07-17-2013 02:06 AM

If you want to get a perfect score, than put it on your server and have it cached for as long as you want.

Create a cron job to always download the latest version from google Smile

Like Patrick said,
Don't do it.


RE: Expires Headers + google-analytics.com/ga.js - Paras - 10-21-2014 08:27 PM

Our website get %84 score on my page http://www.pajasaapartments.com/ in google page speed and showing following error

http://www.google-analytics.com/ga.js missing expiry time


Suggest how to remove same .


RE: Expires Headers + google-analytics.com/ga.js - pmeenan - 10-24-2014 03:31 AM

Don't worry about it, it's not in your control. As long as you are using the async analytics snippet you are fine. Optimize of the actual performance, not necessarily the scores.


RE: Expires Headers + google-analytics.com/ga.js - acetech - 10-05-2018 05:57 AM

(07-16-2013 11:35 PM)pmeenan Wrote:  Don't do it. Google Analytics is used across so much of the web that it is almost guaranteed to be in a user's cache even with a short expires.

i checked my website www.ace-services.uk in Gtmetrix and shows Add Expires headers https://www.google-analytics.com/analytics.js Grade C and need to optimise , shall i leave that as it is ?


RE: Expires Headers + google-analytics.com/ga.js - bdfuel - 12-16-2018 10:53 PM

Same problem for my website https://www.banglabook.org/ , thought score is PageSpeed Score
(99%) ,YSlow Score(92%) .


RE: Expires Headers + google-analytics.com/ga.js - https://AlphaPress.co - 02-11-2019 09:49 PM

Easy fix. Use CAOS plugin https://wordpress.org/plugins/host-analyticsjs-local/

CAOS for Google Analytics allows you to host analytics.js locally and keep it updated using WordPress’ built-in Cron-schedule. Fully automatic!