Caching interview question · Most asked

How can a CDN leak one user's data to another, and how do you prevent it?

Summary

If a personalized response lacks Cache-Control: private, no-store (or the CDN ignores origin headers), the shared cache stores it by URL and serves it to the next visitor. Mark personalized responses private, make the CDN respect headers, and don't cache responses with Set-Cookie/Authorization.

Longer Answer

Split pages into a shared, cacheable shell and client-loaded personalized parts; add automated checks that authenticated endpoints return private/no-store.

Key Points

  • Shared caches key by URL
  • private, no-store for personal data
  • CDN must respect origin headers

Deep dive: Database Caching at Scale

More most-asked Caching questions

← All Caching questions