โ Web Performance (Core Web Vitals) learning pathWeb Performance (Core Web Vitals) ยท Module 6 of 8
Caching, CDNs and compression
Do not send the same bytes twice.
๐ Key ideas
- Cache-Control headers tell browsers how long they may reuse a file.
- Give built files a content hash in the name (app.3f9a.js) so they can be cached for a year and still update safely.
- A CDN serves files from servers close to the user, cutting travel time.
- Compress text files with Brotli or gzip; they often shrink by 70% or more.
- HTML usually gets a short cache or revalidation so users see new releases.
๐ก Real-life example: A CDN is like keeping stock in local shops across Tamil Nadu instead of making every customer travel to one warehouse in Chennai.
Cache-ControlHTTP header that sets caching rules
CDNNetwork of servers that deliver files from near the user
Content hashFingerprint in a file name that changes when content changes
BrotliCompression method for text files such as JS and CSS