I have a simple web app running behind nginx using flask+gunicorn and somewhere along the line a stale version of the page is being cached. My nginx config has add_header Cache-Control no-cache;
and proxy_buffering off;
in the location for the proxy pass. I did some searching and found that gunicorn itself does not cache anything. My application also does not cache anything, or at least I haven't written it to.
server {
listen 80;
server_name mywebsite.com;
location / {
add_header Cache-Control no-cache;
proxy_pass http://127.0.0.1:6789;
proxy_set_header Host $host;
proxy_buffering off;
}
}
That's the nginx config I am using and gunicorn was launched with gunicorn -b 127.0.0.1:6789 -w 5 app:app
and no special configs have been set for it.
Any help diagnosing the problem would be great. Thanks!
edit: Here are the response headers from a request returning the stale page.
Age: 0
Cache-Control: no-cache
Connection: Keep-Alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Date: Mon, 27 Jun 2016 14:27:29 GMT
Server: nginx/1.8.0
Transfer-Encoding: chunked