Nginx cache filename

Daniel Biazus daniel.biazus at
Wed Jan 20 19:11:34 UTC 2016

You may use the md5 function in order to get the cache file on filesystem,

If you use the cache key "$host$uri$is_args$args" and the cache base path
is /var/cache/nginx/ and cache has 2 levels (levels=1:2)

Considering the URL ""

The cache file name will be

Based on:

echo -n '' | md5sum

First level = 5
Second level = 43
Filename = 6e281642dfbf0b9ebf4cfb30142ab435

Hope it helps

On Wed, Jan 20, 2016 at 6:05 AM, Tigran Bayburtsyan <
tigran.bayburtsyan at> wrote:

> Hi All
> I’m doing centralized service for clearing our servers Nginx cache for
> specific files, but I can’t find the algorithm how Nginx making cache file
> based on request and cache_key.
> The only thing in documentation is
> How can I get cache file path for this static file
> ?
> Thanks
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at


Daniel Biazus
infrastructure Engineering
Azion Technologies
Porto Alegre, Brasil +55 51 3012 3005 | +55 51 82279032
Miami, USA +1 305 704 8816

Quaisquer informações contidas neste e-mail e anexos podem ser
confidenciais e privilegiadas, protegidas por sigilo legal. Qualquer forma
de utilização deste documento depende de autorização do emissor, sujeito as
penalidades cabíveis.

Any information in this e-mail and attachments may be confidential and
privileged, protected by legal confidentiality. The use of this document
require authorization by the issuer, subject to penalties.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list