diff --git a/cloudflare worker.js b/cloudflare worker.js index de815a3..d505e42 100644 --- a/cloudflare worker.js +++ b/cloudflare worker.js @@ -979,14 +979,15 @@ function handleOptions() { } // Helper to create standardized responses -function createResponse(body, status = 200, shouldCache = false, cacheDuration = 300) { +function createResponse(body, status = 200, cacheDuration = 60*60*24) { const headers = { 'Content-Type': 'application/json', ...corsHeaders }; - if (shouldCache) { + if (cacheDuration > 0) { headers['Cache-Control'] = `public, max-age=${cacheDuration}`; + headers['CDN-Cache-Control'] = `public, max-age=${cacheDuration}`; } else { headers['Cache-Control'] = 'no-store'; }