From f7a532137a3d98e2c0d6fde376387325455f5444 Mon Sep 17 00:00:00 2001
From: log
Date: Tue, 23 Jun 2026 21:10:10 +0800
Subject: [PATCH] fix: prevent browser caching of config and models APIs
---
video-claw/video-claw/backend/api/routers/pipelines.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/video-claw/video-claw/backend/api/routers/pipelines.py b/video-claw/video-claw/backend/api/routers/pipelines.py
index eb75e0e..77851b6 100644
--- a/video-claw/video-claw/backend/api/routers/pipelines.py
+++ b/video-claw/video-claw/backend/api/routers/pipelines.py
@@ -5,7 +5,7 @@
from urllib.parse import quote
from typing import Optional
-from fastapi import APIRouter, BackgroundTasks, HTTPException, Query
+from fastapi import APIRouter, BackgroundTasks, HTTPException, Query, Response
from fastapi.responses import HTMLResponse, StreamingResponse
from api.schemas.pipelines import (
@@ -149,11 +149,13 @@
@router.get("/api/models")
async def get_api_models(
+ response: Response,
media_type: Optional[str] = Query(None, pattern="^(image|video)$"),
model_type: Optional[str] = Query(None, pattern="^(llm|vlm|t2i|i2i|video)$"),
ability: Optional[str] = Query(None),
verified_only: bool = False,
):
+ response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
if model_type:
models = []
for model in get_models_by_type(model_type):
--
Gitblit v1.8.0