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 = `