fix(falukant): revalidate replaced character meshes
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s

This commit is contained in:
Torsten Schulz (local)
2026-09-30 14:40:50 +02:00
parent 6d14038dad
commit c02bc07265
2 changed files with 9 additions and 2 deletions

View File

@@ -14,7 +14,10 @@ router.get('/3d/falukant/characters/:filename', async (req, res) => {
try {
const cachePath = await getOptimizedModelPath(filename);
res.setHeader('Content-Type', 'model/gltf-binary');
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
// GLB files can be replaced under the same filename during an asset deploy.
// Revalidate cached copies so clients receive a changed mesh without needing
// to clear their browser cache.
res.setHeader('Cache-Control', 'public, max-age=0, must-revalidate');
res.sendFile(cachePath);
} catch (e) {
if (e.message?.includes('Invalid model filename') || e.message?.includes('not found')) {