Welcome! Log In Create A New Profile

Advanced

Re: Multiple Cache Object for same file

Maxim Dounin
July 02, 2020 11:44AM
Hello!

On Thu, Jul 02, 2020 at 05:06:17AM -0400, anish10dec wrote:

> We are observing that multiple cache object is getting created for same file
> in Nginx Cache which is resulting into non optimal use of cache storage.
>
> We are using proxy_cache_key as $uri.
>
> proxy_cache_key $uri;
>
> For example with file having URI
> /content/entry/jiomags/content/719/51/51_t_0.jpg
>
> 2 cache object has been created in cache folder. Both the files are having
> same KEY
>
> -rw------- 1 nginx nginx 21023 Jun 27 16:11
> ./2/95/9d78505da184e6ccd981fefe6b333952
> -rw------- 1 nginx nginx 21023 Jun 27 18:16
> ./f/ad/c8e1c56031a14dd4a27e538956253adf
>
> vi ./2/95/9d78505da184e6ccd981fefe6b333952

[...]

> Vary: Accept-Encoding^M

[...]

> What could be the reason for duplicate file getting cached having same URI
> and KEY.
> Please help

The reason is the "Vary: Accept-Encoding" header line returned by
your backend. If you want nginx to ignore it, consider using
"proxy_ignore_headers Vary;", see
http://nginx.org/r/proxy_ignore_headers for details.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Multiple Cache Object for same file

anish10dec July 02, 2020 05:06AM

Re: Multiple Cache Object for same file

Maxim Dounin July 02, 2020 11:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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