4 ms·
So I recorded my site for a while. Then sorted by unused bytes. What was on top? Google's own analytics.js
by TekMol 9y ago
So I recorded my site for a while. Then sorted by unused bytes. What was on top?
Google's own analytics.js
- tedmiston 9y agouBlock blocking it perhaps?
- chinathrow 9y agoI feel your sentiment. Same with Google PageSpeed Insights. Cache time of analytics.js is the shit.
- SquareWheel 9y agoAre you blocking analytics using a browser addon?
- manigandham 9y agoAll 3rd party vendors have to include code for many features, websites, browsers and devices. They will always contain unused code. GA does a lot and it's doubtful you're using much of it.
- corobo 9y agoThey could at least gzip the damn thing or whatever their own pagespeed tool says is wrong with every asset loaded from Google
- singlow 9y agoIt complains about the cache expiration time being too short. But there are good reasons they can't cache it longer. The short cache has no significant effect on page performance, as long as it is loaded async, but there is no way the performance tool can determine that unless it white listed it which would not be fair to someone else's tracking script.
- manigandham 9y agoPagespeed is a subpar tool that really shouldn't be used much. Follow the best practices and don't try to fix every possible little complaint. As far as Google serving files though, its about as optimized as it gets. The JS file is gzip'd, served by Google's cloud network and on chrome it even uses their own QUIC protocol which is faster. It's also likely cached by the sheer amount of usage across the web so it'll probably be the fastest loading thing on your entire site.
- corobo 9y agoBut I want the number to be green :( Fair point, I think I've been accidentally gamified when it comes to the pagespeed test. Good call.
- untog 9y agoIf you're very concerned about it, you can implement your own solution sending HTTP calls to GA: https://developers.google.com/analytics/devguides/collection/protocol/v1/ https://developers.google.com/analytics/devguides/collection...