Skip to content
Astera Technology

Keep cached API results within the caller’s permission scope

Separate shared HTTP caching from application cache keys and permission changes.

Include the actual data scope in the design

RFC 9111 distinguishes private and no-store directives. Those headers do not automatically govern a custom in-memory cache. This local design keys authorised results by tenant, subject, scope and relevant policy revision; do not place raw credentials in a key.

Synthetic cache-scope checks
RequestAvailable cacheDecision
Tenant A, reader U1Tenant B resultNever reuse across tenant boundary
U1 after export permission removedResult under earlier policy revisionCheck current permission; refuse revoked export and invalidate the cached result
Sensitive response marked no-storeCustom persistence pathEnsure that path also respects storage policy
Download editable CSV ↓

Test a policy change against a warm cache

Populate the cache as an authorised synthetic user, remove the relevant permission and repeat the request. The revoked export must return no restricted response body even with a warm cache. Log the cache decision with safe identifiers, without copying the private response into diagnostics.

Does Cache-Control: private alone prevent your own application from sharing one result between users?

Show the worked answer

No. It constrains compliant shared HTTP caches; your application still needs correct scope keys, access checks and invalidation rules.

Related resources