This commit is contained in:
team3
2026-06-30 00:14:18 +02:00
parent 3e3559aa8f
commit c794fcaccf
152 changed files with 9485 additions and 9583 deletions

View File

@@ -16,7 +16,7 @@ from routes import router
@asynccontextmanager
async def lifespan(app: FastAPI):
(STORAGE_DIR / "themen").mkdir(parents=True, exist_ok=True)
(STORAGE_DIR / "topics").mkdir(parents=True, exist_ok=True)
await init_db()
await reconcile_guides()
yield
@@ -24,8 +24,8 @@ async def lifespan(app: FastAPI):
class CachedStatic(StaticFiles):
"""StaticFiles mit Cache-Control: gehashte Assets dauerhaft (immutable),
index.html nie cachen (verweist immer auf die aktuellen Asset-Hashes)."""
"""StaticFiles with Cache-Control: hashed assets forever (immutable),
index.html never cached (it always points at the current asset hashes)."""
async def get_response(self, path, scope):
resp = await super().get_response(path, scope)
if path.startswith("assets/"):
@@ -37,7 +37,7 @@ class CachedStatic(StaticFiles):
app = FastAPI(title="Creator", lifespan=lifespan)
# gzip für JS/CSS-Bundle + große JSON-Antworten (~1,39 MB JS → ~400 KB).
# gzip for the JS/CSS bundle + large JSON responses (~1.39 MB JS → ~400 KB).
app.add_middleware(GZipMiddleware, minimum_size=500)
app.include_router(router)