mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
fix: fix cache duration
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user