fix: force-reload ONLYOFFICE API.js each session + Date.now for truly unique doc key

This commit is contained in:
root
2026-07-16 12:02:45 +00:00
parent 46d2bf4931
commit 8b6b083d3d
5 changed files with 15 additions and 10 deletions

View File

@@ -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:23:15.854Z"
"updatedAt": "2026-07-16T11:52:26.701Z"
}
]

View File

@@ -143,7 +143,8 @@ router.get('/:templateId/config', (req, res) => {
// Get file modification time for cache-busting doc key
const fileStats = fs.statSync(template.path);
const fileMtime = fileStats.mtimeMs;
const docKey = generateDocKey(templateId, fileMtime);
// Use Date.now() as the primary uniqueness driver — guaranteed fresh every time
const docKey = generateDocKey(templateId, Date.now());
const fileName = template.originalName || template.name + '.docx';
// Add file mtime as cache-buster to the document URL so ONLYOFFICE