Web Vitals & Performance (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
High-Performance Caching: Stale-While-Revalidate and Edge CDNs.
senior LevelMost AskedCode ExampleFormsPerformanceSystem Design
In Simple Words:
http
Cache-Control: public, max-age=60, s-maxage=3600, stale-while-revalidate=86400
- Users always receive cached responses from the nearest CDN edge PoP in $<30\text{ms}$.
- In the background, the CDN fetches fresh content from the origin server when
s-maxageexpires without delaying user requests.