File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,22 @@ export async function githubApiRequest(
155155 headers . set ( "Authorization" , `token ${ env . GITHUB_TOKEN } ` ) ;
156156 }
157157
158- // Make the request
158+ // Configure Cloudflare's tiered cache
159+ const cfCacheOptions = {
160+ cacheEverything : true ,
161+ cacheTtlByStatus : {
162+ "200-299" : 3600 , // Cache successful responses for 1 hour
163+ "404" : 60 , // Cache "Not Found" responses for 60 seconds
164+ "500-599" : 0 , // Do not cache server error responses
165+ } ,
166+ } ;
167+
168+ // Make the request with tiered cache
159169 const response = await fetch ( url , {
160170 ...options ,
161171 headers,
162172 credentials : "omit" , // Avoid CORS issues
173+ cf : cfCacheOptions , // Use Cloudflare's tiered cache
163174 } ) ;
164175
165176 // Update rate limit info from response headers
You can’t perform that action at this time.
0 commit comments