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 theContent-Encodingheader's value is br or gzip – 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.
  • This behavior and Adaptive Media Delivery, Download Delivery, and Object Delivery. By design, these products assume that all content is cacheable. So, the Remove Vary Header behavior is automatically included in the background, and it's set to On. You can override this default by adding this behavior to the Default Rule and setting it to Off. But, you'll see a warning message stating that you're deviating from the best practices established for these products. This warning is informational, only.