What is an Account-Control Surface?
Understand the account-control surface and why account protection has to cover more than the login form.
The Vary header is an HTTP response header that informs caches how to match future request headers to decide whether a cached response is reusable. Essentially, it tells the cache that the response may vary based on certain request headers.
Imagine you have a website that serves content in different languages based on the user's "Accept-Language" header. If you cache the English version of the page, you don't want to serve this cached version to someone requesting the page in Spanish. This is where the Vary header comes into play.
Using the Vary header ensures that caches correctly handle content that varies based on factors such as user-agent, language, encoding, and more. It helps in serving personalized content without accidentally delivering the wrong version from the cache.
However, incorrect use of the Vary header can reduce caching efficiency. If it is overused or misconfigured, it may lead to a low cache hit ratio, as the cache might consider too many variations, leading to storing multiple versions that rarely get reused.
© PEAKHOUR.IO PTY LTD 2026 ABN 76 619 930 826 All rights reserved.