From 3d408e3b3a7f43f10a017d401c1c1e423a02d557 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 23 Sep 2019 17:33:10 +0100 Subject: [PATCH] Add Cache-Control response header The Thumbor version used to have this client side caching, would be nice to have it again. --- source/image-handler/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/image-handler/index.js b/source/image-handler/index.js index 840b5bf74..331068058 100755 --- a/source/image-handler/index.js +++ b/source/image-handler/index.js @@ -52,7 +52,8 @@ const getResponseHeaders = (isErr) => { "Access-Control-Allow-Methods": "GET", "Access-Control-Allow-Headers": "Content-Type, Authorization", "Access-Control-Allow-Credentials": true, - "Content-Type": "image" + "Content-Type": "image", + "Cache-Control": "max-age=31536000,public" } if (corsEnabled) { headers["Access-Control-Allow-Origin"] = process.env.CORS_ORIGIN; @@ -61,4 +62,4 @@ const getResponseHeaders = (isErr) => { headers["Content-Type"] = "application/json" } return headers; -} \ No newline at end of file +}