fix: move cache-busting to server side

This commit is contained in:
ceruleandeep
2024-12-22 08:43:35 +11:00
parent 78a1397a3c
commit 7bb37f129d
2 changed files with 2 additions and 3 deletions

View File

@@ -124,9 +124,10 @@ router.get('/get', jsonParser, function (request, response) {
})
.map((file) => {
const pathToSprite = path.join(spritesPath, file);
const mtime = fs.statSync(pathToSprite).mtime?.toISOString().replace(/[^0-9]/g, '').slice(0, 14);
return {
label: path.parse(pathToSprite).name.toLowerCase(),
path: `/characters/${name}/${file}`,
path: `/characters/${name}/${file}` + (mtime ? `?t=${mtime}` : ''),
};
});
}