]> git.ardis.lu - ardislu.dev/commitdiff
Configure cache rule on fetch from origin
authorArdis Lu <ardisglu@gmail.com>
Sun, 27 Mar 2022 19:39:16 +0000 (12:39 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 27 Mar 2022 19:39:16 +0000 (12:39 -0700)
functions/api.js

index a5802380b84053e896b840d577435d1a4e40c367..dcca070bc8179251dfbb136fe711fc591b089415 100644 (file)
@@ -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}`
     }
This page took 0.043102 seconds and 4 git commands to generate.