-1

I'm new at flask and programing, and I want to ask is it possible to get browser update css without hard reset? because its very frustrating every time I change something go into browser and hit CTRL + F5.

from flask_web import app

if "__main__" == __name__:
    app.run(debug=True)

1 Answers1

0

Try setting SEND_FILE_MAX_AGE_DEFAULT to -1 as follows.

app.config['SEND_FILE_MAX_AGE_DEFAULT'] = -1

It basically sets the Cache-Control header to an expiry in seconds. -1 essentially disables the caching. The default is 12 hours or 43200. This header tells your browser when to reload individual assets.

Nishan
  • 3,644
  • 1
  • 32
  • 41