From: Ardis Lu Date: Sun, 27 Mar 2022 19:39:16 +0000 (-0700) Subject: Configure cache rule on fetch from origin X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=1f1e6a9eda065ac6c9c97b7ababf2377f567417d;p=ardislu.dev Configure cache rule on fetch from origin --- diff --git a/functions/api.js b/functions/api.js index a580238..dcca070 100644 --- a/functions/api.js +++ b/functions/api.js @@ -70,6 +70,10 @@ export async function onRequestGet({ request, env }) { const token = await getGoogleAuthToken(email, privateKey, scopes); const response = await fetch(queryString, { + cf: { + cacheEverything: true, + cacheTtl: 86400 + }, headers: { Authorization: `Bearer ${token}` }