Disabling caching in Flask

后端 未结 4 1686
执念已碎
执念已碎 2020-11-30 01:27

I have some caching issues. I\'m running very small web-application which reads one frame, saves it to the disk and then shows it in browsers window.

I know, it is p

4条回答
  •  春和景丽
    2020-11-30 02:06

    If you have always the same problem, that Flask didn't see the updates in JS and CSS files, that because by default, Flask has as max-age value 12 hours. You can set it to 0 to resolve the problem like this:

    app = Flask(__name__)
    app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
    

    Refer to its documentation for details.

提交回复
热议问题