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:
+16
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user