From 86a7bd21eb4ff594498cdcbceb7af8a4af6a114c Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Thu, 30 Apr 2020 00:13:35 -0700 Subject: [PATCH] cache proxied images for 1 day --- api/assetProxy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/assetProxy.js b/api/assetProxy.js index 21a33f6..d2ba266 100644 --- a/api/assetProxy.js +++ b/api/assetProxy.js @@ -33,5 +33,8 @@ export default async (req, res) => { ); res.status(proxyRes.status); + if (proxyRes.ok) { + res.setHeader("Cache-Control", "public, max-age=86400"); // 1 day + } streamPipeline(proxyRes.body, res); };