Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_key

ST
June 10, 2017 05:20PM
Hi Francis,

On Sat, 2017-06-10 at 07:49 +0100, Francis Daly wrote:
> 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?

Thank you very much for the detailed answer. Now I understand what the
line meant. However I'm not sure it solves my problem. Actually I was
trying to translate following two lines from Apache config into nginx,
however it is probably not related to fastcgi_cache_key, as I have
initially assumed...

Here are the two lines:
RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}]
RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}]

Do you know what is their equivalent in nginx?

Thank you in advance!

_______________________________________________
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: 210
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