fix: no-cache headers on config+download endpoints, cache-bust config fetch from frontend

This commit is contained in:
root
2026-07-16 11:14:10 +00:00
parent 60a07e9ba8
commit 92291be2b1
4 changed files with 12 additions and 2 deletions

View File

@@ -264,7 +264,9 @@ async function loadOnlyofficeTemplates() {
async function openOnlyofficeEditor(templateId, templateName) {
try {
// Get the JWT-signed editor config from our backend
const resp = await fetch(ONLYOFFICE_API + '/' + templateId + '/config');
// Add cache-buster to prevent browser caching the old config
const cacheBuster = Date.now();
const resp = await fetch(ONLYOFFICE_API + '/' + templateId + '/config?cb=' + cacheBuster);
if (!resp.ok) {
const err = await resp.json();
throw new Error(err.error || 'Failed to get editor config');