Welcome! Log In Create A New Profile

Advanced

Accept Header / cache versioning issue

August 19, 2015 12:00PM
Hi Guys,

I noticed that Nginx 1.8.X is taking into account the Client Header "Accept" for versioning the cache objects, for instance:

This request, generates one object in cache:

curl -sv -o /dev/null 'http://www.foo.bar/image.png -H 'Accept: */*'

And this, generates another one:

curl -sv -o /dev/null 'http://www.foo.bar/image.png -H 'Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2'

This one, another one, and so on:

curl -sv -o /dev/null 'http://www.foo.bar/image.png -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

Considering this behaviour:

it will generate many versions of the same object in cache, using much more disc resources, space, IO.

It will reduce the cache hit ratio, as a consequence, will reduce the performance.

Then, I have a question:

Is there any way to normalize the Accept header, or even ignore it ?

Thanks in advance,

Biazus
Subject Author Posted

Accept Header / cache versioning issue

biazus August 19, 2015 12:00PM

Re: Accept Header / cache versioning issue

Francis Daly August 19, 2015 01:36PM

Re: Accept Header / cache versioning issue

biazus August 19, 2015 01:42PM

Re: Accept Header / cache versioning issue

B.R. August 19, 2015 05:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 123
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