No-Vary-Search, that allows cache to be shared even when the query strings differ.GET's to *.r2.cloudflarestorage.com?autohttps://<accountid>.r2.cloudflarestorage.com, instead of amazonaws.com?
it does not do anything like letting a single cache lookup give back a response with a different URL.https://github.com/WICG/nav-speculation/blob/main/no-vary-search.md
R2Bucket. Basic usage, If-Unmodified-Since a R2 specific thing? For some reason I thought it was in the S3 API for putobject, but it doesn't seem like it is..walterwick.de A @1.1.1.1 +noall +answerdiggy diggy hole
•4/1/24, 5:31 PM
await-ing the .put() call thoughawait fixed it. Weird that it was working locally tho. Thanks for your help!const localizedBucket = localizeBucket({
buckets: {
wnam: env.WNAM_BUCKET,
enam: env.ENAM_BUCKET,
weur: env.WEUR_BUCKET,
eeur: env.EEUR_BUCKET,
apac: env.APAC_BUCKET,
},
fallbackRegion: 'wnam',
});
const object = await localizedBucket.head('some-key', { request });NAME | TTL | DATA
--------------+------+---------------
walterwick.de | 284s | 172.67.180.219
walterwick.de | 284s | 104.21.83.189 app.post("/image", async (c) => {
const {file}: {file: File} = await c.req.parseBody();
if (!file) return c.json({ msg: "Invalid request" }, 400);
const body = await file.arrayBuffer()
const id = nanoid()
console.log(id, body);
c.env.BUCKET.put(id + ".bmp", body);
return c.json({id}, 200)
});No-Vary-Search*.r2.cloudflarestorage.comNo-Vary-Search: params=("X-Amz-Credential" "X-Amz-Date" "X-Amz-Expires" "X-Amz-SignedHeaders" "X-Amz-Signature")https://<accountid>.r2.cloudflarestorage.comamazonaws.com