@@ -23,8 +23,8 @@ function getErrorBadgeSVG(message: string) {
23
23
async function rateLimit ( c : any , next : ( ) => Promise < any > ) {
24
24
const ip = c . req . raw . headers . get ( "cf-connecting-ip" ) || "unknown" ;
25
25
const KEY_PREFIX = "ratelimit:" ;
26
- const LIMIT = 10 ;
27
- const WINDOW = 300 ;
26
+ const LIMIT = 60 ;
27
+ const WINDOW = 60 ;
28
28
29
29
try {
30
30
const key = `${ KEY_PREFIX } ${ ip } ` ;
@@ -327,11 +327,9 @@ app.get("/visitor-badge/:repo", async (c) => {
327
327
return new Response ( svg , {
328
328
headers : {
329
329
"Content-Type" : "image/svg+xml; charset=utf-8" ,
330
- "Cache-Control" : "public, max-age=60, s-maxage=60, stale-while-revalidate=300" ,
331
- "CDN-Cache-Control" : "max-age=60" ,
332
- "Surrogate-Control" : "max-age=60" ,
333
- "Edge-Control" : "max-age=60" ,
334
- "Age" : "0" ,
330
+ "Cache-Control" : "no-cache, no-store, must-revalidate" ,
331
+ "Pragma" : "no-cache" ,
332
+ "Expires" : "0" ,
335
333
"Vary" : "Accept-Encoding" ,
336
334
"ETag" : `"${ count } "`
337
335
} ,
@@ -468,8 +466,9 @@ app.get("/ai-badge", async (c) => {
468
466
return new Response ( svg , {
469
467
headers : {
470
468
"Content-Type" : "image/svg+xml; charset=utf-8" ,
471
- "Cache-Control" : "public, max-age=1800" ,
472
- "CDN-Cache-Control" : "public, max-age=1800" ,
469
+ "Cache-Control" : "no-cache, no-store, must-revalidate" ,
470
+ "Pragma" : "no-cache" ,
471
+ "Expires" : "0"
473
472
} ,
474
473
} ) ;
475
474
0 commit comments