Nginx cache 1 KEY into multiple cache files (cache not running)

Guilherme guilherme.e at gmail.com
Thu Nov 19 14:12:18 UTC 2015


Maxim,

In these cases, when Vary is present in response headers and generate
multiple cache files for the same key, how nginx determines  cache file
names for variants?

Tks,

Guilherme



On Thu, Nov 19, 2015 at 11:26 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Wed, Nov 18, 2015 at 09:40:45PM -0500, semseoymas wrote:
>
> > First, the specs:
> > nginx version: nginx/1.8.0
>
> [...]
>
> > The problem here: if people asks nginx for the same request_uri, it will
> > create multiple files!! this way, the cache is not running ok...
>
> Multiple cache files for the same key can be created if a backend
> response uses the Vary mechanism to allow multiple resource
> variants.  It is supported and taken into account when caching
> since nginx 1.7.7, http://nginx.org/en/CHANGES:
>
>     *) Change: now nginx takes into account the "Vary" header line in a
>        backend response while caching.
>
> If responses are really the same, consider removing Vary from
> backend responses.  If it not possible for some reason, you can
> use proxy_ignore_headers to stop nginx from handling Vary in
> responses, e.g.:
>
>     proxy_ignore_headers Vary;
>
> Some additional details can be found in the documentation here:
>
> http://nginx.org/r/proxy_ignore_headers
>
> --
> Maxim Dounin
> http://nginx.org/
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20151119/698238aa/attachment.html>


More information about the nginx mailing list