title: AWS CloudFront, `Vary` header and content negotiation
body: <p>I'm trying to implement content negotiation based on client <code>Accept</code> headers so that clients that accept <code>image/webp</code> get webp images while clients that don't get plain old jpeg. webp and jpeg image are served from the same url, i.e. /images/foo-image/ and the content returned varies on the <code>Accept</code> header presented by the client. This now works great on my site.</p>
  
  <p>Next challenge is to get this working AWS CloudFront sitting in front of my site. I'm setting the <code>Vary</code> header to <code>Vary: Accept</code> to let CloudFront know that it has to cache and serve different content based on the client <code>Accept</code> headers.</p>
  
  <p>This doesn't seem to work unfortunately, i.e. CloudFront just serves up whatever it first gets it's hands on, <code>Vary</code> and <code>Accept</code> notwithstanding. Interestingly, CloudFront does seem to be able to vary content based on <code>Accept-Encoding</code> (i.e. gzip).</p>
  
  <p>Does anyone know what gives?</p>