auto-sync: 2026-05-21 20:57:52
This commit is contained in:
+3
-3
@@ -265,17 +265,17 @@ async def list_projects_compat():
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 靜態文件服務(前端 dist/,F18 實現)
|
||||
# 静态文件服务(前端 dist/,F18 实现)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
DIST_DIR = Path(__file__).parent / "frontend" / "dist"
|
||||
if DIST_DIR.exists():
|
||||
# v3.1: 緩存策略 - HTML 不緩存(確保新版本生效),JS/CSS 長緩存(Vite content hash 已處理)
|
||||
# v3.1: 缓存策略 - HTML 不缓存(确保新版本生效),JS/CSS 长缓存(Vite content hash 已处理)
|
||||
import mimetypes
|
||||
_static_app = StaticFiles(directory=str(DIST_DIR), html=True)
|
||||
|
||||
class CachedStaticFiles:
|
||||
"""包裝 StaticFiles,添加 Cache-Control 頭"""
|
||||
"""包装 StaticFiles,添加 Cache-Control 头"""
|
||||
def __init__(self, app):
|
||||
self._app = app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user