Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Any examples of the bad advice that would slow down the page?


A very basic example: if you had a large site, you can raise my Google Page Speed score by inlining all CSS and JS, but that would be stupid because it doesn't take into account the next page load and caching. I've seen some render blocking optimizations slow the overall page too. Getting rid of query strings is nice, but sometimes you need it for cache busting and other things, but it penalizes your score. Even Google's own tag manager/analytics scripts lowers your page speed score when they are on the site.


>> Even Google's own tag manager/analytics scripts lowers your page speed score when they are on the site.

I never understood why Google doesn't fix this. I want to use Google Analytics but their own tool penalizes me for it because it gets unproperly cached on Google's own servers? That's just stupid.


It's just a tool with a random score - why does it matter? Most of the recommendations are now outdated. Focus on overall experience and there are plenty of RUM monitoring scripts you can use (that take advantage of the very fine grained performance timings available in browsers today).


> sometimes you need it for cache busting

So it’s not good for speed

> Even Google's own tag manager/analytics scripts lowers your page speed score

Well these don’t exactly speed up loading your page.


Inlining assets is even less important and more of an overoptimization as HTTP2 pipelining takes over. Its like threading..used to be expensive and a sign of bad code whereas now, since everyone has cores to spare, its a sign of good algorithm use.


Http 2 handles loading multiple files better. So bundling isn't that important anymore.

Also, no need to put assets in a different domain anymore ( limit on loading resources per domain simultaneously)


> Also, no need to put assets in a different domain anymore

It's even considered harmful since extra domains means extra dns lookups which could take quite a while.


I’d say bundling is more important than ever right now in the modern JS ecosystem where an average site or app uses dozens of NPM modules.


As mentioned, in Http2 and server push... No need for bundling.

I agree on http 1.1. Sorry that you downvoted on a lack of knowledge ;)


No, I understand HTTP2 and the advantages server push brings (on paper). When you consider it’s inconsistent implementation across browser vendors and that it really works best only in a scenario with optimal connection quality, I’d say it’s bad advice to tell people to stop bundling JavaScript especially in today’s world where an average codebase is likely going to have a ton of modules.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: