diff --git a/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx b/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx index 0969f58..4b2cb21 100644 Binary files a/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx and b/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx differ diff --git a/renderer/carbone-templates/registry.json b/renderer/carbone-templates/registry.json index 3834aa3..2afa399 100644 --- a/renderer/carbone-templates/registry.json +++ b/renderer/carbone-templates/registry.json @@ -6,6 +6,6 @@ "originalName": "master_cv_template.docx", "path": "/root/workspace/cv-app/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx", "uploadedAt": "2026-07-16T09:03:29.601Z", - "updatedAt": "2026-07-16T11:09:51.737Z" + "updatedAt": "2026-07-16T11:12:12.609Z" } ] \ No newline at end of file diff --git a/renderer/onlyoffice-service.js b/renderer/onlyoffice-service.js index a5aaa40..1c8ed69 100644 --- a/renderer/onlyoffice-service.js +++ b/renderer/onlyoffice-service.js @@ -135,6 +135,11 @@ router.get('/:templateId/config', (req, res) => { return res.status(404).json({ error: 'Template file missing' }); } + // Prevent browser caching of the config — always return fresh config + res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); + res.setHeader('Pragma', 'no-cache'); + res.setHeader('Expires', '0'); + // Get file modification time for cache-busting doc key const fileStats = fs.statSync(template.path); const fileMtime = fileStats.mtimeMs; @@ -235,6 +240,9 @@ router.get('/:templateId/download', (req, res) => { const fileName = template.originalName || template.name + '.docx'; res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'); res.setHeader('Content-Disposition', `attachment; filename="${fileName}"`); + res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); + res.setHeader('Pragma', 'no-cache'); + res.setHeader('Expires', '0'); const fileStream = fs.createReadStream(template.path); fileStream.pipe(res); diff --git a/static/carbone.js b/static/carbone.js index 3d2321d..87d83e2 100644 --- a/static/carbone.js +++ b/static/carbone.js @@ -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');