PERF: NGINX caching invalid when server sets cookies

This commit is contained in:
Sam 2015-05-22 14:23:47 +10:00
parent 535e8cac5d
commit de3e48c16e
1 changed files with 6 additions and 1 deletions

View File

@ -163,10 +163,15 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $thescheme;
# if Set-Cookie is in the response nothing gets cached
# this is double bad cause we are not passing last modified in
proxy_ignore_headers "Set-Cookie";
# note x-accel-redirect can not be used with proxy_cache
proxy_cache one;
proxy_cache_valid any 1m;
proxy_cache_valid 200 301 302 7d;
proxy_cache_valid any 1m;
proxy_pass http://discourse;
break;
}