Preview cache-busting: Cache-Control: no-cache na endpoint + ?v=Date.now() v frontend URL — browser ne sme cachat starega output-a po recutu
This commit is contained in:
+6
-1
@@ -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
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user