fix: index.html强制no-cache(浏览器缓存致前端改动不生效,子Tab看不到根因)

This commit is contained in:
xxm
2026-08-18 07:43:46 +08:00
parent 87292da309
commit f4b15dde47
+6 -1
View File
@@ -230,7 +230,12 @@ def _save_watchlist(data):
@app.route("/")
def index():
return send_from_directory(app.static_folder, "index.html")
# 2026-08-18 强制不缓存 index.html(浏览器缓存导致前端改动不生效,老莫反馈子Tab看不到)
resp = send_from_directory(app.static_folder, "index.html")
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = "0"
return resp
@app.route("/api/watch")