Google Insights tells me to "Leverage browser caching" for "https://www.google-analytics.com/analytics.js". How can I do it?

74 views
Skip to first unread message

pet...@testpilot.co

unread,
Nov 14, 2017, 3:15:31 AM11/14/17
to pagespeed-insights-discuss
Hello

Google Insights tells me to "Leverage browser caching" for "https://www.google-analytics.com/analytics.js".

How can I do it? It is google's script on google's server

Thanks

Rick Steinwand

unread,
Nov 14, 2017, 2:41:00 PM11/14/17
to pagespeed-insights-discuss
You answered your own question.

Nothing.

Chris Chris

unread,
Nov 15, 2017, 3:48:25 PM11/15/17
to pagespeed-insights-discuss
That's not actually true.  There are some efforts out there where users are implementing local copies of analytics.  I don't believe all of them are supported, but there are some workarounds.  See https://www.keycdn.com/blog/leverage-browser-caching/

pet...@testpilot.co

unread,
Nov 16, 2017, 2:01:33 AM11/16/17
to pagespeed-insights-discuss
thanks, Chris! very nice idea!

Rick Steinwand

unread,
Nov 16, 2017, 9:40:48 AM11/16/17
to pagespeed-insights-discuss
Much easier to just postload it, which decreased my page load time by .2 seconds: https://github.com/danielstjules/defer-analytics 

Setting up a cron job to update a local script for a 1% increase in score is hardly worth it, IMO.
Reply all
Reply to author
Forward
0 new messages