โ† Web Performance (Core Web Vitals) learning path
Web Performance (Core Web Vitals) ยท Module 6 of 8

Caching, CDNs and compression

Do not send the same bytes twice.

๐Ÿ“– Key ideas

  1. Cache-Control headers tell browsers how long they may reuse a file.
  2. Give built files a content hash in the name (app.3f9a.js) so they can be cached for a year and still update safely.
  3. A CDN serves files from servers close to the user, cutting travel time.
  4. Compress text files with Brotli or gzip; they often shrink by 70% or more.
  5. 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