404's are cached but it's impossible to tell why it happened without a repro
404's are cached but it's impossible to tell why it happened without a repro
x-amz-expiration in metadata for objects to delete them, without having set up a lifecycle in r2?
R2PutOptions? https://developers.cloudflare.com/r2/api/workers/workers-api-reference/#r2putoptions



%23
x-amz-expirationR2PutOptionsconst object = await env.BUCKET.get("key from request");
const headers = new Headers();
object.writeHttpMetadata(headers);
headers.set('etag', object.httpEtag);
return new Response(object.body, { headers });// e.g. via curl with --data-binary "@somefile.jpg"
await bucket.put(key, req.body, { httpMetadata: { contentType } });
// from a web page
const formData = await req.formData();
const file = formData.get('file') as File
const body = await file.arrayBuffer();
await bucket.put(file.name, body, { httpMetadata: { contentType: file.type } });