File tree 1 file changed +12
-1
lines changed
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(
155
155
headers . set ( "Authorization" , `token ${ env . GITHUB_TOKEN } ` ) ;
156
156
}
157
157
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
159
169
const response = await fetch ( url , {
160
170
...options ,
161
171
headers,
162
172
credentials : "omit" , // Avoid CORS issues
173
+ cf : cfCacheOptions , // Use Cloudflare's tiered cache
163
174
} ) ;
164
175
165
176
// Update rate limit info from response headers
You can’t perform that action at this time.
0 commit comments