fix: fix cache duration

This commit is contained in:
tdurieux
2021-09-10 11:59:21 +02:00
parent ea3a696556
commit 89e9c60942
3 changed files with 4 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ router.get(
anonymizedPath.substring(anonymizedPath.lastIndexOf("/") + 1)
);
// cache the file for 5min
res.header('Cache-Control', 'max-age=250000');
res.header('Cache-Control', 'max-age=300');
await f.send(res);
} catch (error) {
return handleError(error, res);

View File

@@ -34,7 +34,7 @@ router.get(
res.attachment(`${repo.repoId}.zip`);
// cache the file for 6 hours
res.header("Cache-Control", "max-age=21600000");
res.header("Cache-Control", "max-age=21600");
await pipeline(repo.zip(), res);
} catch (error) {
handleError(error, res);
@@ -49,7 +49,7 @@ router.get(
if (!repo) return;
try {
// ache the file for 6 hours
res.header("Cache-Control", "max-age=21600000");
res.header("Cache-Control", "no-cache");
res.json(await repo.anonymizedFiles({ includeSha: false }));
} catch (error) {

View File

@@ -93,7 +93,7 @@ export default async function start() {
express.static(path.join(__dirname, "..", "public"), {
etag: true,
lastModified: true,
maxAge: 3600000, // 1h
maxAge: 3600, // 1h
})
);