Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› HTTP Cache
Cyber Security

HTTP Cache

← Back to Glossary
By NHI Mgmt Group Updated November 16, 2026 Domain: Cyber Security

An HTTP cache is a storage layer that saves responses to HTTP requests so they can be reused for later requests. It works with cacheable headers such as Cache-Control, ETag, Last-Modified and Vary, and can sit in a browser, proxy or CDN. Misconfigured caching can expose stale or user-specific content.

How HTTP caching works

HTTP caching stores a previously fetched response so later requests can reuse it instead of forcing the origin server to regenerate the same content. The cache key is shaped by request and response metadata, especially headers such as Cache-Control, ETag, Last-Modified and Vary, which tell intermediaries when reuse is safe and when a fresh response is required.

That reuse can happen at several layers, including the browser, an intermediary proxy, or a CDN. The same mechanism that reduces latency and origin load can also widen the blast radius of a bad caching rule, because one shared response may be served to many users if the cache logic does not distinguish audiences correctly.

Cacheability, freshness, and revalidation

Freshness is the core idea behind HTTP cache behaviour. A response may be considered fresh for a defined period, reused immediately, or revalidated with the origin if the cache has an entity tag or last-modified timestamp. In practice, this creates a trade-off between performance and accuracy, because aggressive reuse lowers load while stricter validation increases traffic back to the origin.

Cache-Control is the main policy lever for controlling this behaviour. Directives such as max-age, no-store, no-cache, private and public influence whether a response can be stored, whether it may be shared, and whether it must be checked again before reuse. Misunderstanding those directives is a common source of caching bugs, especially when teams assume that “cached” only means “faster” rather than “possibly shared and persistent.”

Cache keys and content variation

Vary is what prevents a cache from treating all requests as equivalent when the response depends on request headers. If a response changes for different encodings, languages, user agents, cookies or other request attributes, the cache must incorporate that variation or it may return the wrong representation to the wrong requester.

Because cache keys are a security boundary as much as a performance mechanism, careful variation matters for personalised pages, authenticated content and multi-tenant applications. A weak key or incomplete Vary handling can create cross-user content mixing, while an overly broad key can destroy cache efficiency and reduce the benefits that made caching worthwhile in the first place.

For browser-side leak analysis and cache probing behaviour, the XS-Leaks Guide is a useful companion reference because it explains how cached or cross-origin behaviour can reveal information indirectly.

Security implications of misconfigured HTTP caches

HTTP cache mistakes are dangerous because the failure mode is often silent. A response that should have been private can be stored and reused, and a response that should have been separated by user context can be served across sessions. That can expose stale content, account-specific data, or access-controlled pages long after the origin has changed its state.

Cache poisoning and cache deception are also relevant failure patterns. If an attacker can influence what gets stored, or can make a cache believe that an attacker-controlled response is safe to serve broadly, they may be able to persist misleading content, leak sensitive data, or cause victims to receive content that was never intended for them.

Risk and Threat Considerations

HTTP caches can become an exposure amplifier when they sit in front of personalised or access-controlled content. The main risk is not the cache itself, but the incorrect assumption that a response is safe to reuse across requesters when the response actually depends on identity, cookies, headers or session state.

Failure mechanism: A cache stores or reuses the wrong variant because the response was marked too broadly, the cache key was incomplete, or variation headers did not fully describe the differences between users or contexts. That can expose stale content, cross-user data, or attacker-influenced responses.

Impact: The result can include confidentiality loss, session confusion, incorrect authorisation decisions at the presentation layer, and difficult-to-diagnose incidents because the origin server may appear healthy while intermediaries continue serving the bad object.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5, CIS Controls v8 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SC-4 — Information in Shared System ResourcesHTTP caches share responses across requesters and must prevent unintended disclosure.
AC-6 — Least PrivilegeCache scope should not grant broader reuse than the requester or context requires.
CM-6 — Configuration SettingsCache directives and proxy settings are configuration controls that govern reuse and invalidation.
Recommendation — Apply SC-4 to prevent shared cache responses from exposing data across users or sessions. Apply AC-6 to limit which responses can be reused across users and contexts. Use CM-6 to standardise and enforce safe cache-control and variation settings.
CIS Controls v8CIS-16 — Application Software SecurityHTTP caching behaviour is part of application security and safe response handling.
Recommendation — Review application caching logic to prevent sensitive or user-specific responses from being cached incorrectly.
OWASP ASVSV13 — ConfigurationCaching safety depends on secure configuration of headers, proxies and browser behaviour.
Recommendation — Verify cache directives, Vary handling, and no-store/no-cache usage during configuration review.

Practitioner Guidance

What to watch for: Treat every cacheable response as a policy decision, not just a performance optimisation. User-specific pages, authenticated responses and anything influenced by cookies or headers should be reviewed for explicit cache scope, correct variation handling and safe invalidation behaviour.

Governance implication: Ownership needs to span application teams, CDN or reverse-proxy operators, and incident responders, because the effective behaviour of an HTTP cache is defined by both origin headers and intermediary enforcement. NIST SP 800-53 Rev 5 Security and Privacy Controls is a useful control reference for managing configuration, access control, auditability and system integrity around cache-related decisions.

Practitioner takeaway: If a cached response could ever differ by user, session or privilege, make that difference explicit in cache policy and verify it across every layer that can store or serve the response.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 16, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org