From: Ardis Lu Date: Thu, 21 Jul 2022 03:00:00 +0000 (-0700) Subject: Remove Cache-Control response header X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=df61f2bdb4c71a295e5241a2ecf6a6414c5072e4;p=ardislu.dev Remove Cache-Control response header This logic is handled by the client-side service worker --- diff --git a/functions/api.js b/functions/api.js index ed462eb..f6c2fb3 100644 --- a/functions/api.js +++ b/functions/api.js @@ -11,7 +11,7 @@ export async function onRequestGet({ request, env }) { const token = await getGoogleAuthToken(env.EMAIL, env.PRIVATE_KEY, env.SCOPES); - const response = await fetch(queryUrl, { + return fetch(queryUrl, { cf: { cacheEverything: true, cacheTtl: 86400 @@ -20,9 +20,4 @@ export async function onRequestGet({ request, env }) { Authorization: `Bearer ${token}` } }); - - const newResponse = new Response(response.body, response); - newResponse.headers.set('Cache-Control', 'max-age=86400, stale-while-revalidate=604800'); - - return newResponse; }