From 1f1e6a9eda065ac6c9c97b7ababf2377f567417d Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sun, 27 Mar 2022 12:39:16 -0700 Subject: [PATCH] Configure cache rule on fetch from origin --- functions/api.js | 4 ++++ 1 file changed, 4 insertions(+) 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}` } -- 2.47.3