I agree with Roy Fielding on this: > It is a bad design trade-off to send a bunch of header fields on every request just to tell the server all of the possible variations of preference held by the user, particularly when there is a very small chance that any of those dimensions are applicable to the target resource. It has been a bad design trade-off ever since the very brief period in 1993-94 when folks didn't know…
If you do content negotiation, then it’s imperative to send “Vary: accept” in your response. CF and all other CDNs will automatically do the right thing when they see that header. Content negotiation still has its uses, but most of the time you’re better off using different endpoints.
Akamai is another case where Vary is harmful, from their docs [1]:
> 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
> Content-Encoding header's value is br or gzip – edge servers cache
> such responses, applying the caching rules you defined in your property.
Cloudflare's docs do seem to indicate they support the Vary header as does Fastly. But one should read the docs of their CDN to find out the behavior. Do not assume Vary is supported.https://techdocs.akamai.com/property-mgr/docs/rm-vary-header