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:
OpenClaw Agent
2026-05-02 12:24:19 +00:00
parent c1e00b7b73
commit 7a7d7ea20d
2 changed files with 10 additions and 3 deletions
+4 -2
View File
@@ -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 = `
<div class="modal-content" onclick="event.stopPropagation()">
<button class="modal-close" title="Zapri (ESC)">×</button>
<video src="/api/preview/${id}" controls autoplay playsinline></video>
<video src="/api/preview/${id}?v=${cacheBust}" controls autoplay playsinline></video>
${title ? `<div class="modal-title">${title}</div>` : ""}
<div class="modal-actions">
<button class="primary" onclick="window.open('/api/download/${id}')">⬇ Prenesi reel</button>
<button class="primary" onclick="window.open('/api/download/${id}?v=${cacheBust}')">⬇ Prenesi reel</button>
<button onclick="closeModal()">Zapri</button>
</div>
</div>