<div dir="ltr">Maxim,<div><br></div><div>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?</div><div><br></div><div>Tks,</div><div><br></div><div>Guilherme</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 19, 2015 at 11:26 AM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<span class=""><br>
On Wed, Nov 18, 2015 at 09:40:45PM -0500, semseoymas wrote:<br>
<br>
> First, the specs:<br>
> nginx version: nginx/1.8.0<br>
<br>
</span>[...]<br>
<span class=""><br>
> The problem here: if people asks nginx for the same request_uri, it will<br>
> create multiple files!! this way, the cache is not running ok...<br>
<br>
</span>Multiple cache files for the same key can be created if a backend<br>
response uses the Vary mechanism to allow multiple resource<br>
variants. It is supported and taken into account when caching<br>
since nginx 1.7.7, <a href="http://nginx.org/en/CHANGES" rel="noreferrer" target="_blank">http://nginx.org/en/CHANGES</a>:<br>
<br>
*) Change: now nginx takes into account the "Vary" header line in a<br>
backend response while caching.<br>
<br>
If responses are really the same, consider removing Vary from<br>
backend responses. If it not possible for some reason, you can<br>
use proxy_ignore_headers to stop nginx from handling Vary in<br>
responses, e.g.:<br>
<br>
proxy_ignore_headers Vary;<br>
<br>
Some additional details can be found in the documentation here:<br>
<br>
<a href="http://nginx.org/r/proxy_ignore_headers" rel="noreferrer" target="_blank">http://nginx.org/r/proxy_ignore_headers</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" rel="noreferrer" target="_blank">http://nginx.org/</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>