Browser caching issues in flask

后端 未结 2 1697
南旧
南旧 2020-12-05 01:13

I have built a website using flask (www.csppdb.com). Sometimes when I log in as one user, log out, then login as another user I still see pages from the first user I logged

2条回答
  •  感情败类
    2020-12-05 01:34

    To stop browser caching on these sort of pages you need to set some HTTP response headers.

    Cache-Control: no-cache, no-store
    Pragma: no-cache
    

    Once you do this then the browser wont cache those pages. I dont know how to do this with "flask" so I will leave that as an exercise for you :)

    This question shows how to add a response header Flask/Werkzeug how to attach HTTP content-length header to file download

提交回复
热议问题