From a41292a0229fcf5a53f17dfeb1ff96e1c5e2a37b Mon Sep 17 00:00:00 2001 From: Ashelyn Dawn Date: Sun, 6 Jun 2021 22:53:35 -0600 Subject: [PATCH] More aggressive image caching --- api/images.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/images.js b/api/images.js index 4a80710..303dbb7 100644 --- a/api/images.js +++ b/api/images.js @@ -5,6 +5,8 @@ const ensureAdmin = require('./middleware/ensureAdmin') router.get('/:uuid/:size', async (req, res) => { const image = await db.item.getImage(req.params.uuid, req.params.size) + const cacheSeconds = 60 * 60 * 24; + res.set('Cache-Control', cacheSeconds); res.set('Content-Type', image.mime_type) res.end(image.file) })