Update2: add uwsgi_ignore_headers Cache-Control Set-Cookie X-Accel-Expires Expires Vary;
and problem solved. Thanks everyone.
Update: I tried uwsgi_ignore_headers Cache-Control Set-Cookie X-Accel-Expires Expires Vary;
. Doesnot work. I also find that, if I make same request in the logout state from different browsers on the same computer, the cache still doesnot work. This is really silly...
I've seen the comments below, but I don't know how to apply it to the config file.
I want to cache url /
, it works well but I find that if I login or logout, the cache doesnot work. why? I just want to cache /
anyway. Here is my cofiguration:
uwsgi_cache_path uwsgi_cache_path /app/path/nginx_cache levels=1:2 keys_zone=my_cache:1m max_size=50m inactive=30m use_temp_path=off;
server {
...
location = / {
uwsgi_pass 127.0.0.1:3032;
include /app/path/uwsgi_params;
uwsgi_cache my_cache;
uwsgi_cache_key "$host$uri$is_args$args";
uwsgi_cache_valid 5m;
}
...
}