mirror of
https://github.com/danbulant/Mangades
synced 2026-07-05 11:00:40 +00:00
more aggresive cache
This commit is contained in:
parent
2a9f699b1b
commit
db7af4bbef
1 changed files with 2 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ export async function GET({ url }) {
|
||||||
const ret = await fetch(url.searchParams.get('url'));
|
const ret = await fetch(url.searchParams.get('url'));
|
||||||
return new Response(await ret.arrayBuffer(), {
|
return new Response(await ret.arrayBuffer(), {
|
||||||
headers: {
|
headers: {
|
||||||
|
...ret.headers,
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, HEAD, OPTIONS',
|
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, HEAD, OPTIONS',
|
||||||
'Access-Control-Allow-Headers': 'Content-Type, Accept, X-Requested-With',
|
'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')!,
|
'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()
|
'Expires': new Date(Date.now() + 172800000).toUTCString()
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue