From 1dec4ddd57a857cd7ab94798aca1a32479f7d3e7 Mon Sep 17 00:00:00 2001 From: yanren <86402135+yanren1996@users.noreply.github.com> Date: Wed, 29 Apr 2026 08:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2csv=E8=AB=8B=E6=B1=82?= =?UTF-8?q?=E8=A2=AB=E5=BF=AB=E5=8F=96=E9=80=A0=E6=88=90=20issue#81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index dc3870c..604319a 100644 --- a/server.py +++ b/server.py @@ -794,7 +794,15 @@ async def get_tags_csv(request): return web.json_response({"success": False, "error": "无效的文件名"}, status=400) tags_data = config_manager.load_tags_csv(filename) - return web.json_response({"success": True, "data": tags_data}) + return web.json_response( + {"success": True, "data": tags_data}, + # FIXME #81暫時處裡,防止請求被快取(但根本問題尚需優化) + headers={ + "Cache-Control": "no-store, no-cache, must-revalidate, max-age=0", + "Pragma": "no-cache", + "Expires": "0" + } + ) except Exception as e: print(f"{ERROR_PREFIX} 加载CSV标签文件失败 | 错误:{str(e)}") return web.json_response({"success": False, "error": str(e)}, status=500)