Welcome! Log In Create A New Profile

Advanced

Re: uwsgi_cache only caching root location

Francis Daly
August 16, 2015 02:56AM
On Sun, Aug 16, 2015 at 01:16:21AM -0400, daveyfx wrote:

Hi there,

> uwsgi_ignore_headers Set-Cookie;
>
> This solved my issue. The header is not being sent on the home page, but is
> sent with almost all other pages.

Yes, that's the reason in this case.

"""
If the header includes the “Set-Cookie” field, such a response will
not be cached.
...
Processing of one or more of these response header fields can be disabled
using the uwsgi_ignore_headers directive.
"""

If "Set-Cookie" were cached, then everyone who fetches from the cache
would be invited to set the same cookie, which probably defeats the
purpose of cookies.

Another way to achieve the same would be to turn off the "Set-Cookie"
on the upstream, for all pages that don't need to do it. (Possibly
the upstream is running unnecessary code to check for the existence
if a cookie; and if not, then create a new unique cookie for future
comparison.)


You're effectively doing this now, with the nginx config; but this nginx
method doesn't (trivially) allow you to get a Set-Cookie to the browser
(and avoid caching) for the few pages which might actually need it.

> Thanks for the tips.

You're welcome.

Good that you found an answer, and thanks for sharing it.

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

uwsgi_cache only caching root location

daveyfx August 15, 2015 02:50PM

Re: uwsgi_cache only caching root location

Francis Daly August 15, 2015 05:24PM

Re: uwsgi_cache only caching root location

daveyfx August 15, 2015 07:22PM

Re: uwsgi_cache only caching root location

daveyfx August 15, 2015 09:16PM

Re: uwsgi_cache only caching root location

daveyfx August 16, 2015 01:16AM

Re: uwsgi_cache only caching root location

Francis Daly August 16, 2015 02:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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