FlashcardNot attempted
Making assets load faster
Recall it before you reveal
List the main techniques for loading a site's assets faster.
Space to reveal
Show answer & explanation
- CDN hosting, so files are served from near the user (and cached there)
- Compression: Brotli or gzip for text, modern image formats (AVIF, WebP)
- Minification and tree-shaking of JS and CSS
- Code splitting and lazy loading, so you only ship what the current page needs
- HTTP/2 or HTTP/3 multiplexing, which makes many parallel downloads cheap
- Caching: long
max-agewith content-hashed file names, so repeat visits hit the cache - Resource hints:
preconnectandpreloadfor critical, late-discovered resources