无人机资产管理系统功能更新:状态历史编辑、飞行透视表备注与总架次、批量操作、筛选、表格列顺序调整,静态文件禁用缓存,忽略运行时数据
This commit is contained in:
@@ -1141,4 +1141,13 @@ def export_excel_api(
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- 静态页面
|
||||
app.mount("/", StaticFiles(directory=STATIC_DIR, html=True), name="static")
|
||||
class NoCacheStaticFiles(StaticFiles):
|
||||
"""静态文件禁用缓存:每次请求都让浏览器重新校验(避免改版后看不到更新)。"""
|
||||
|
||||
def file_response(self, *args, **kwargs):
|
||||
resp = super().file_response(*args, **kwargs)
|
||||
resp.headers["Cache-Control"] = "no-cache"
|
||||
return resp
|
||||
|
||||
|
||||
app.mount("/", NoCacheStaticFiles(directory=STATIC_DIR, html=True), name="static")
|
||||
|
||||
Reference in New Issue
Block a user