Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Caching by Vary: Accept header

$
0
0
I'm working to implement the webp image format on our servers following the ideas posted here:
http://www.igvita.com/2012/12/18/deploying-new-image-formats-on-the-web/

Opera includes "image/web" in the Accept header, and with that I'm able to respond with a webp encoded image. Other browsers who do not have "image/webp" in the Accept header will get the standard jpeg response.

In the response headers I'm including "Vary: Accept" in hopes that I'm caching images according to the next request's Accept header (much like how Vary: Accept-Encoding) is working.

However, if I get open the image's URL in Opera, and the webp image gets cached, then I open the same URL in Firefox, then Firefox receives the webp image (which it doesn't support). Instead I would like to cache both a webp and jpg image (just like being able to cache both a plain text or gzip file for the same url, but separating by Accept-Encoding).

Am I correct in saying that NGINX is not configured to work like this out of the box? I'm a newby to NGINX so any assistance for a good starting point would be great.

Thanks in advance,
Adam

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>