if you use aws4fetch, you can get free caching without needing to fiddle with the Cache API manually
if you use aws4fetch, you can get free caching without needing to fiddle with the Cache API manually.
const aws_client = new AwsClient({
accessKeyId: c.env.S3_ACCESS_KEY_ID,
secretAccessKey: c.env.S3_SECRET_ACCESS_KEY,
retries: 0,
service: "s3",
})
const s3_url = new URL(`${c.env.S3_ENDPOINT}/${sha256}.json`);
const s3_result = await aws_client.fetch(s3_url.toString(), {
method: "GET",
cf: {
cacheEverything: true,
cacheTtl: 31536000, // 1 year
}
});

cacheEverything: true cache non-200 responses?cache-control: no-store should do the trickfetch's cache behave with query strings?
cacheTtlByStatus which sounds like it might help with the earlier query, mentioned a bit down from here: https://developers.cloudflare.com/workers/runtime-apis/request/#requestinitcfpropertiescacheTtlByStatus is ent? I thought it was for everyone? Cache-Control: max-age=0, no-cache, no-store



cacheEverything: truecache-control: no-storecacheTtlfetchcacheTtlByStatuscacheTtlByStatusCache-Control: max-age=0, no-cache, no-storefor(let i = 0; i < 10; i++) {
await new Promise(r => setTimeout(r, 5000));
const result = await fetch(loc);
// ...
}