Caching interview question · Most asked

What are the risks of caching personalized or authorized data?

Summary

If cache keys or HTTP caching rules don't include the user, tenant or permissions, one user's data can be served to another, a serious data leak. CDNs caching authenticated responses are a common source of such incidents.

Longer Answer

Mark personalized responses Cache-Control: private or no-store, include tenant/user in application cache keys, and test cache behavior with multiple users.

Key Points

  • Keys must include identity
  • private/no-store for user data
  • Beware CDNs on authenticated routes
  • Test with multiple users

More most-asked Caching questions

← All Caching questions