From 7a7d7ea20da32359641a9d0e778ddb8f4e09cf7b Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Sat, 2 May 2026 12:24:19 +0000 Subject: [PATCH] =?UTF-8?q?Preview=20cache-busting:=20Cache-Control:=20no-?= =?UTF-8?q?cache=20na=20endpoint=20+=20=3Fv=3DDate.now()=20v=20frontend=20?= =?UTF-8?q?URL=20=E2=80=94=20browser=20ne=20sme=20cachat=20starega=20outpu?= =?UTF-8?q?t-a=20po=20recutu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 7 ++++++- templates/index.html | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 3d17a18..74ebed9 100644 --- a/app/main.py +++ b/app/main.py @@ -1521,6 +1521,7 @@ async def preview(job_id: str, request: Request, user: str = Depends(check_auth) "Accept-Ranges": "bytes", "Content-Length": str(chunk_size), "Content-Type": "video/mp4", + "Cache-Control": "no-cache, must-revalidate", # browser ne sme cachat starega output-a } return StreamingResponse(iter_file(), status_code=206, headers=headers, media_type="video/mp4") @@ -1531,7 +1532,11 @@ async def preview(job_id: str, request: Request, user: str = Depends(check_auth) return FileResponse( out, media_type="video/mp4", - headers={"Accept-Ranges": "bytes", "Content-Length": str(file_size)}, + headers={ + "Accept-Ranges": "bytes", + "Content-Length": str(file_size), + "Cache-Control": "no-cache, must-revalidate", # browser ne sme cachat starega output-a + }, ) diff --git a/templates/index.html b/templates/index.html index 3bfe3f7..ec2041a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1773,15 +1773,17 @@ function previewJob(id, title) { // Odpre velik modal z reel videom + // Dodaj timestamp cache-buster da browser ne servira starega cached output-a + const cacheBust = Date.now(); const overlay = document.createElement("div"); overlay.className = "modal-overlay"; overlay.innerHTML = `