Remove Vary Header
Use this behavior to determine how to handle the caching of responses if they incorporate the Vary
header.
How it works
The Vary
header is often used to indicate varied content in the response even though the URL is the same. For example, content can vary based on its associated language.
As the content in response may be different for the same URL, Akamai edge servers don't cache responses that include the Vary
header, even if the content is cacheable by definition. The only exception is the case where the Vary
header's value is Accept-Encoding
and the response also includes the Content-Encoding: gzip
header – edge servers cache such responses, applying the caching rules you defined in your property.
Implementation
To enable caching of these responses via Akamai edge servers, you must remove the Vary
header. You can accomplish this in one of two ways:
- Remove the
Vary
header at the origin server. It isn't needed here. (This is the preferred method.) - Include the Remove Vary Header behavior in your property and set it to ON. This will remove Vary headers other than "Vary: Accept-Encoding" from the response.
AMD & Object Delivery and the Vary
header
Vary
headerAs a best practices setting, configurations for the Adaptive Media Delivery (AMD) and Object Delivery products assume that all content is cacheable. So, the Vary HTTP Header is removed by default, before content is cached. The Remove Vary Header behavior is automatically included in the property, in the background, and it's set to ON. This can be reversed, if necessary. However, a warning message is displayed stating that you're deviating from the best practices established for these products. This warning is informational, only.
Updated 1 day ago