fix(falukant): revalidate replaced character meshes
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
All checks were successful
Deploy to production / deploy (push) Successful in 1m55s
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user