How is this Website so fast?
youtube.com
youtube.com
- Server delivers HTML, not JSON
- Pre-loading product page HTML on hover
- Properly enabling caching on the CDN
- Using service worker caching
- Using ASP.net
- DNS pre-fetching entries for other image and web domains
- Pre-loading fonts that CSS will later load, as well as some images
- Critical CSS inline: put the structural CSS for layout in <header> in a style tag inline, without fetching anything
- Assign fixed pixel width and height to image to improve layout speed (this technique goes back to the 1990s!)
- Javascript delivered to the page is a subset of all javascript, based on what's needed
- Uses Yuyi JS library, a 2008 Yahoo library, plus jQuery
- Still ~800kb of Javascript, but the focus is getting HTML on the page first
These are all observations, so it's not clear if all or some are crucial for performance.
Discussion on the same (16 points, 11 hours ago, 10 comments) https://news.ycombinator.com/item?id=41883419