1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Add caching to static files

This commit is contained in:
Patrik J. Braun 2023-03-05 23:34:18 +01:00
parent 3fa4f59ebe
commit 6c4670daa7

View File

@ -171,7 +171,10 @@ export class PublicRouter {
if (!fs.existsSync(file)) {
return res.sendStatus(404);
}
res.sendFile(file);
res.sendFile(file, {
maxAge: 31536000,
dotfiles: 'allow',
});
};
};