From de3e48c16e4309146de4ff8c5b3f2e063a289f06 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 22 May 2015 14:23:47 +1000 Subject: [PATCH] PERF: NGINX caching invalid when server sets cookies --- config/nginx.sample.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index 6dbd5a32d89..8a2816f4d70 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -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; }