SECURITY ENGINEERING, IN PRACTICE.ANALYSIS / TECHNICAL NOTES / FIELD NOTES
Packet Notes.

Clear thinking on software,
infrastructure and security.

Technical note

A cache key is part of your access model

Two requests for the same URL are not necessarily entitled to the same response.

The representation has an audience

A cache sits between a request and a representation. If the representation depends on a tenant, account or permission, the cache design must preserve that distinction. The route alone may not describe the audience for the response.

RFC 9111 defines HTTP caching behavior, including restrictions for shared caches and responses to authenticated requests. Application-specific identity still needs deliberate treatment. A cache-control header should be reviewed alongside the actual behavior of the CDN, proxy and application.

Draw the two-request case

Our preferred review uses a pair of legitimate users. Write down the complete request context for each and the response each should receive. Then identify every place where one response could satisfy the other request: edge cache, reverse proxy, application memoization and generated exports.

Check redirects and errors as well as successful responses. A correct data endpoint can coexist with a stale redirect or a cached authorization result. The question is whether reuse preserves the intended audience at each layer.

Treat invalidation as a requirement

When membership changes, determine which cached objects and decisions remain usable. Include the longest relevant freshness interval in the review. Document the expected behavior rather than assuming that a cache purge and a permission update reach every layer at the same instant.

Separate storage from reuse

RFC 9111 gives these directives different jobs: an unqualified private directive excludes shared-cache storage; no-cache requires successful validation before reuse; no-store prohibits storage by caches. None makes a response confidential on its own.

For a review fixture, let two disposable accounts request the same invoice URL. Record account, cache status, response identifier and visible owner for a cold request, a warm request and a request after membership removal. An unchanged URL does not imply an unchanged authorization decision. Use synthetic invoices so the test itself cannot disclose customer data.

Source & further reading

IETF RFC 9111 · HTTP Caching ↗