Live data from Hacker News

System loads web pages 34 percent faster by fetching files more effectively

news.mit.edu

31–40 of 105 posts

Re: System loads web pages 34 percent faster by fetching files more effectively

#31
post #28

but we can already make web pages load 500% faster by not shoveling a ton of shit, not loading scripts from 60 third-party domains (yes stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection), reducing total requests to 1.22MB embedded youtube players [1], 500kb of other js bloat, 200kb of webfonts, 150kb of…

One gripe: the canonical CDNs may have the library already cached from your visits to other sites, which is faster. I wish that web browsers would use content addressing to load stuff and do SRIs. If I already loaded a javascript file from another url, why load it again?

https://thethemefoundry.com/blog/why-we-dont-use-a-cdn-spdy-...

Re: System loads web pages 34 percent faster by fetching files more effectively

#32

but we can already make web pages load 500% faster by not shoveling a ton of shit, not loading scripts from 60 third-party domains (yes stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection), reducing total requests to 1.22MB embedded youtube players [1], 500kb of other js bloat, 200kb of webfonts, 150kb of…

This is only slightly related, but I've noticed HN comment pages take a second or two to load when there are many comments (500+). Page sizes are not unreasonable (100-200 kb). What is the cause for these pages loading so slowly? Example 900+ comment page: https://news.ycombinator.com/item?id=11116274 Example 2200+ comment page: https://news.ycombinator.com/item?id=12907201

[deleted]

Re: System loads web pages 34 percent faster by fetching files more effectively

#33

but we can already make web pages load 500% faster by not shoveling a ton of shit, not loading scripts from 60 third-party domains (yes stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection), reducing total requests to 1.22MB embedded youtube players [1], 500kb of other js bloat, 200kb of webfonts, 150kb of…

> stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection Do you have a source for this? My understanding is that, in real usage, it is cheaper to load common libraries from a CDN because in a public CDN (for something like jQuery), the library is likely to already be cached from another website and has a cha…

jQuery was a poor example in the original comment. You almost 100% have jQuery cached if you're getting it from CDN. But this only works for extremely widely used libraries (jQuery, Bootstrap, etc.). It drives me nuts when I see tiny little libraries in Github bragging about being on a CDN. They just don't have the usage for it to be efficient.

Re: System loads web pages 34 percent faster by fetching files more effectively

#34

but we can already make web pages load 500% faster by not shoveling a ton of shit, not loading scripts from 60 third-party domains (yes stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection), reducing total requests to 1.22MB embedded youtube players [1], 500kb of other js bloat, 200kb of webfonts, 150kb of…

This is only slightly related, but I've noticed HN comment pages take a second or two to load when there are many comments (500+). Page sizes are not unreasonable (100-200 kb). What is the cause for these pages loading so slowly? Example 900+ comment page: https://news.ycombinator.com/item?id=11116274 Example 2200+ comment page: https://news.ycombinator.com/item?id=12907201

The server is taking a long time to render the response. In the first link, 650ms or so. Open the network tab in your browser developer tools to see the details.

Re: System loads web pages 34 percent faster by fetching files more effectively

#36

but we can already make web pages load 500% faster by not shoveling a ton of shit, not loading scripts from 60 third-party domains (yes stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection), reducing total requests to 1.22MB embedded youtube players [1], 500kb of other js bloat, 200kb of webfonts, 150kb of…

> stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection Do you have a source for this? My understanding is that, in real usage, it is cheaper to load common libraries from a CDN because in a public CDN (for something like jQuery), the library is likely to already be cached from another website and has a cha…

Using a CDN for common libraries may help, but doesn't always, and is something you should measure rather than just assume. The situation where a CDN actually hurts performance is one I've seen periodically at different clients.

When people talk about serving jQuery, or J. Random JavaScript library, from a CDN it means the specific version of jQuery (or whatever) that they're using. There's literally no guarantee that the specific version you need will be in any given user's browser cache, and this is exacerbated if you loading multiple libraries from a CDN, or from different CDNs. If your CDNs serve files with low latency then it may not be a big problem, but not all CDNs do. Slow responding CDNs will slow your page loads down, not the reverse.

Moreover, if you're serving over HTTP2/SPDY there's even less likely to be a benefit to using a CDN. Again, it's something you need to measure.

One area where a CDN (e.g., Cloudflare) can benefit you is by serving all your static content to offer users a low-latency experience regardless of where they are in the world, but that's rather a different matter from serving half a dozen libraries from half a dozen different CDNs.

Re: System loads web pages 34 percent faster by fetching files more effectively

#38
From my experience preconnect is a big improvement for connecting to 3rd party domains. Will also mention that once you have JS deferred, CSS on a 3rd party domain (google fonts) can cause some major slowdowns in terms of the start rendering metrics if using HTTP/2 on a slow connection; all the bandwidth is used for the primary domain connection and not used for blocking resources, end result being images get downloaded before external blocking CSS.

Re: System loads web pages 34 percent faster by fetching files more effectively

#39

but we can already make web pages load 500% faster by not shoveling a ton of shit, not loading scripts from 60 third-party domains (yes stop using CDNs for jQuery/js libs, those https connections aren't free - they're much more expensive than just serving the same script from your existing connection), reducing total requests to 1.22MB embedded youtube players [1], 500kb of other js bloat, 200kb of webfonts, 150kb of…

Testify Testify Brother Testify!
Post reply on HN