Welcome! Log In Create A New Profile

Advanced

Re: How to disable fastcgi caching for the logged user?

Francis Daly
August 08, 2017 02:32PM
On Mon, Aug 07, 2017 at 04:47:30AM -0400, Etienne Robillard wrote:

Hi there,

> Thank you for your reply. What is the difference between:
>
> fastcgi_no_cache $http_pragma $http_authorization
>
> and
>
> fastcgi_no_cache $remote_user

http://nginx.org/r/fastcgi_no_cache
http://nginx.org/r/$http_
http://nginx.org/r/$remote_user

In each case, if the request is handled by a fastcgi_pass, then the
response will[*] be cached unless certain conditions apply.

In the first case, the conditions are that either there is a Pragma:
header (other than "Pragma: 0") or an Authorization: header (other than
"Authorization: 0") in the initial request.

In the second case, the condition is if "user name supplied with the
Basic authentication" is not empty (and, I guess, not 0). Basic
authentication uses the Authorization: header; it is not the only thing
that uses that header, and I guess that there may be a separate way to
populate that variable (but I have not investigated).

[*] strictly, it is more like "will not, not be cached". There are other
reasons why the response might not be cached.

> In addition, how can I verify the configuration is working as expected?

Watch the logs. Watch the network traffic. Watch the files on the filesystem.

Make a http request. Did it go to the fastcgi server? Was the response
cached? (Was a file in the cache recently modified?)

Repeat the http request? Did this one go to the fastcgi server, or was
it served from cache?

Did each of them do what you wanted them to do?

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

How to disable fastcgi caching for the logged user?

Etienne Robillard August 05, 2017 02:44PM

Re: How to disable fastcgi caching for the logged user?

Etienne Robillard August 05, 2017 03:26PM

Re: How to disable fastcgi caching for the logged user?

Francis Daly August 06, 2017 05:50AM

Re: How to disable fastcgi caching for the logged user?

Etienne Robillard August 07, 2017 04:50AM

Re: How to disable fastcgi caching for the logged user?

Francis Daly August 08, 2017 02:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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