uwsgi_cache only caching root location
francis at daoine.org
Sun Aug 16 06:54:37 UTC 2015
On Sun, Aug 16, 2015 at 01:16:21AM -0400, daveyfx wrote:
> 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
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.
Good that you found an answer, and thanks for sharing it.
Francis Daly francis at daoine.org
More information about the nginx