From 605c07508380648b36be225bdf0d3f381585efe5 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 17 Nov 2022 09:03:08 +0000 Subject: [PATCH] Add cache to raw file api --- src/pages/api/files/[fileId].js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/api/files/[fileId].js b/src/pages/api/files/[fileId].js index 250cb9a..ad09afa 100644 --- a/src/pages/api/files/[fileId].js +++ b/src/pages/api/files/[fileId].js @@ -16,6 +16,7 @@ export default async function handler(req, res) { } res.setHeader("Content-Type", file.contentType); // Set the content type header + res.setHeader("Cache-control", "public, max-age=3600"); // Cache the file for 1 hour readStream.pipe(res); // Send the file to the client }