I’m using Flask to make a web app and using mustache templates (alongwith sammy.js). I’m running the app with debug=True but whenever I make changes in the mustache template (or other static assets) I need to clear the browser cookies and cache to make sure that the changes are visible. Other times, I need to use Chrome in incognito mode to see the changes. How can I avoid this hassle? Is there a way to see the changes by just reloading the page.
I’m using Flask to make a web app and using mustache templates (alongwith sammy.js).
Share
The simplest way would be to deactivate the cache in your browser. In Chrome is there a great checkbox under the settings of the web inspector.
A other way should be to remove the cache http header keys. There is a flask settings key
SEND_FILE_MAX_AGE_DEFAULTwith that you should control the cache lifetime of static files.