From: Ardis Lu Date: Sun, 27 Mar 2022 10:06:25 +0000 (-0700) Subject: Update Cache-Control header X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=63c67ecff5f48198ef7a58457b95f39fd4603347;p=ardislu.dev Update Cache-Control header --- diff --git a/functions/api.js b/functions/api.js index fe6d8b3..a580238 100644 --- a/functions/api.js +++ b/functions/api.js @@ -75,5 +75,8 @@ export async function onRequestGet({ request, env }) { } }); - return response; + const newResponse = new Response(response.body, response); + newResponse.headers.set('Cache-Control', 'max-age=86400, stale-while-revalidate=604800'); + + return newResponse; }