Fix: no-cache headers for static files, null guards in loadQueue/loadGallery, error boundaries in initializeApp, add paused to queue filter

This commit is contained in:
2026-07-01 09:01:54 -04:00
parent 9a8d3a814a
commit 037eb6ae23
2 changed files with 23 additions and 7 deletions
+16
View File
@@ -19,6 +19,22 @@ import app.upscaler as upscaler
app = FastAPI(title="AI Video Upscaler Dashboard")
# Middleware to prevent browser caching of static files (dev mode)
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Request
class NoCacheStaticMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
response = await call_next(request)
path = request.url.path
if path.endswith(('.js', '.css', '.html')) or path == '/':
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
return response
app.add_middleware(NoCacheStaticMiddleware)
# CORS middleware for local development
app.add_middleware(
CORSMiddleware,