0

We are using Nginx 1.10 to serve files in a production environment for a Django 1.7 backend and a Flask 0.10.1 frontend. Currently we have have the no-cache header set to prevent caching on error pages:

location /ohno/ {
    # Prevent caching on error pages.
    add_header Cache-Control "no-cache" always;
    try_files $uri/index.html $uri.html @flask;
    root {{ www_dir }}/{{ abc_server_name }}/apps/build/;
}

But I've heard that some people are intermittently having issues where a 502/503 Flask error page is mistakenly shown on their browser and even if they refresh or try again later the error page is still there. They have to delete cookies to access the site.

I thought the no-cache header prevented caching but cookies are still being saved and not removed when they shouldn't be. I went through the nginx and server logs with no luck and I'm unable to replicate the issue on our test environment.

Any ideas?

1 Answers1

0

Cookies and cache are not the same thing, the no-cache has no influence on whether the browser should store cookies or not.

You could set cookies to expire though when you set them.

Ginnungagap
  • 2,595
  • 10
  • 13