From c4aba35e18ef719f2e46766f16edf7d57df06c7d Mon Sep 17 00:00:00 2001 From: mei23 Date: Sun, 18 Feb 2024 18:16:57 +0900 Subject: [PATCH] =?UTF-8?q?Proxy=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A57=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/file/index.ts | 4 ++-- src/server/file/send-drive-file.ts | 2 +- src/services/drive/add-file.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/file/index.ts b/src/server/file/index.ts index edfcb96e34a3..7a3d225aa9dc 100644 --- a/src/server/file/index.ts +++ b/src/server/file/index.ts @@ -21,14 +21,14 @@ router.get('/default-avatar.jpg', ctx => { const file = fs.createReadStream(`${__dirname}/assets/avatar.jpg`); ctx.body = file; ctx.set('Content-Type', 'image/jpeg'); - ctx.set('Cache-Control', 'max-age=2592000, s-maxage=172800, immutable'); + ctx.set('Cache-Control', 'max-age=2592000, s-maxage=604800, immutable'); }); router.get('/app-default.jpg', ctx => { const file = fs.createReadStream(`${__dirname}/assets/dummy.png`); ctx.body = file; ctx.set('Content-Type', 'image/jpeg'); - ctx.set('Cache-Control', 'max-age=2592000, s-maxage=172800, immutable'); + ctx.set('Cache-Control', 'max-age=2592000, s-maxage=604800, immutable'); }); router.get('/:id', sendDriveFile); diff --git a/src/server/file/send-drive-file.ts b/src/server/file/send-drive-file.ts index 9ac57ef8b8a8..38fd4a8227c2 100644 --- a/src/server/file/send-drive-file.ts +++ b/src/server/file/send-drive-file.ts @@ -184,7 +184,7 @@ async function sendNormal(ctx: Router.RouterContext, body: Buffer | stream.Strea return; } } else { - ctx.set('Cache-Control', 'max-age=2592000, s-maxage=172800, stale-while-revalidate=300, stale-if-error=86400, immutable'); + ctx.set('Cache-Control', 'max-age=2592000, s-maxage=604800, stale-while-revalidate=300, stale-if-error=86400, immutable'); } ctx.body = body; diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts index cab6c68f2169..603d6a5a1a2a 100644 --- a/src/services/drive/add-file.ts +++ b/src/services/drive/add-file.ts @@ -297,7 +297,7 @@ async function upload(key: string, stream: fs.ReadStream | Buffer, type: string, Key: key, Body: stream, ContentType: type, - CacheControl: 'max-age=2592000, s-maxage=172800, stale-while-revalidate=300, stale-if-error=86400, immutable', + CacheControl: 'max-age=2592000, s-maxage=604800, stale-while-revalidate=300, stale-if-error=86400, immutable', } as PutObjectCommandInput; if (filename) params.ContentDisposition = contentDisposition('inline', filename);