Why Cache?
To improve response times, we can introduce a cache—a store for the results of expensive or frequently performed operations. Instead of recomputing or re-fetching every time, we serve from the cache when possible. Caching appears at almost every layer: hardware (CPU caches), operating systems, web browsers, web applications, and more. Here we focus on application- and data-tier caching.
Caching static content: CDNs
For static content (images, videos, CSS, JavaScript, fonts), we can use a Content Delivery Network (CDN). CDN servers cache that content at edge locations close to users. When a user requests a static asset, they get it from a nearby CDN node instead of from your origin server. That cuts latency and load on your backend.