From db7af4bbef0078f7aad8a165ab7396970c00fa77 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Sat, 10 Dec 2022 18:01:18 +0100 Subject: [PATCH] more aggresive cache --- src/routes/cors-anywhere/+server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/cors-anywhere/+server.ts b/src/routes/cors-anywhere/+server.ts index 7a023fe..f423fd1 100644 --- a/src/routes/cors-anywhere/+server.ts +++ b/src/routes/cors-anywhere/+server.ts @@ -5,6 +5,7 @@ export async function GET({ url }) { const ret = await fetch(url.searchParams.get('url')); return new Response(await ret.arrayBuffer(), { headers: { + ...ret.headers, 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, HEAD, OPTIONS', 'Access-Control-Allow-Headers': 'Content-Type, Accept, X-Requested-With', @@ -12,7 +13,7 @@ export async function GET({ url }) { 'Content-Type': ret.headers.get('Content-Type')!, - 'Cache-Control': 'public, max-age=172800', // 2 days + 'Cache-Control': 'public, max-age=172800, immutable, stale-while-revalidate=345600, state-if-error=604800', 'Expires': new Date(Date.now() + 172800000).toUTCString() }, });