From a518f45b873acf025000c59ad0f07683c8cc6558 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Fri, 14 Jul 2023 20:51:42 -0600 Subject: [PATCH] feat: added cache control header --- backend/routers/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/routers/index.ts b/backend/routers/index.ts index f23e287..a047a4a 100644 --- a/backend/routers/index.ts +++ b/backend/routers/index.ts @@ -113,6 +113,7 @@ router.get('/direct/:fakeId', async (req, res) => { // Configure response headers res.type(meta!.mimetype) .header('Content-Disposition', `inline; filename="${meta!.filename}"`) + .header('Cache-Control', 'public, max-age=31536000, immutable') .header('Accept-Ranges', 'bytes'); // Send the file (thanks to https://stackoverflow.com/a/67373050)