From 63c67ecff5f48198ef7a58457b95f39fd4603347 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sun, 27 Mar 2022 03:06:25 -0700 Subject: [PATCH] Update Cache-Control header --- functions/api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.47.3