I assume you are loading your CSS files with something like:
{{ url_for('static', filename='some/file.css') }}
For this to refresh immediately in development, you should set the following config var to -1
:
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = -1
As @Matvei states, this issue is more to do with your browser. To visualise this, open the dev tools, go to the Network tab and highlight the specific CSS file. Then in the section on the right look for the following line under Headers -> Response Headers:
Cache-Control: public, max-age=-1
If the setting has been applied correctly this should show -1
. If it shows anything else you need to refresh that specific file, until it does show -1
, possibly having to clear your cache. This is because the browser makes the choice of whether to reload the file based on the Cache-Control
header.
See my similar answer on this with screencaps and links to the docs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…