Welcome! Log In Create A New Profile

Advanced

Caching by Vary: Accept header

Posted by adamdbradley 
Caching by Vary: Accept header
March 27, 2013 10:48AM
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
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready