Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_key

Francis Daly
June 10, 2017 02:50AM
On Fri, Jun 09, 2017 at 04:07:31PM +0300, ST wrote:

Hi there,

> I try to understand an example configuration and have difficulties with
> following line:
>
> fastcgi_cache_key "$request_method|$http_if_modified_since|
> $http_if_none_match|$host|$request_uri";
>
> Could somebody, please, explain what does it mean?

A cache key is the thing that nginx makes up out of the incoming request,
in order to check whether the response is already in the cache (so that
perhaps the response can be served from the cache instead of having to
go to the upstream server to fetch the response).

If you want one request to get the same cached response as another, they
must have the same value for the cache key. If you want one request not
to get the cached response from another, they should have different values
for the cache key (or some other cache-avoiding config must be used).

This particular directive sets the value for the cache key for requests
that might otherwise be handled by a fastcgi_pass directive. The cached
response will only be sent if these five values from the incoming request
are identical.

Does that answer the question?

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

fastcgi_cache_key

ST June 09, 2017 09:08AM

Re: fastcgi_cache_key

Francis Daly June 10, 2017 02:50AM

Re: fastcgi_cache_key

ST June 10, 2017 05:20PM

Re: fastcgi_cache_key

Francis Daly June 11, 2017 05:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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