From dd00ddaa8b8c94f51f462d159f5cbaf7716c3375 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Apr 2026 10:28:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Cache-Control=20=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=8C=E9=87=8D=E5=90=AF=E5=90=8E=E6=97=A0?= =?UTF-8?q?=E9=9C=80=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/web_api.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/web_api.py b/core/web_api.py index 4b7456c..4d14cb8 100644 --- a/core/web_api.py +++ b/core/web_api.py @@ -150,14 +150,22 @@ def admin_required(f): @login_required def index(): """默认首页 - 星图页面""" - return app.send_static_file('graph.html') + resp = app.send_static_file('graph.html') + resp.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' + resp.headers['Pragma'] = 'no-cache' + resp.headers['Expires'] = '0' + return resp @app.route('/graph.html') @login_required def graph_html(): """返回星图页面""" - return app.send_static_file('graph.html') + resp = app.send_static_file('graph.html') + resp.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' + resp.headers['Pragma'] = 'no-cache' + resp.headers['Expires'] = '0' + return resp # 全局服务器和客户端实例 backend_server: BackendServer = None