If you add a domain to your R2 bucket and serve images from it directly, are they cached at the edge
If you add a domain to your R2 bucket and serve images from it directly, are they cached at the edge? Or do I need to put a worker in front of it?
list(), I can see ProxyStub { name: 'HeadResult', poisoned: false }. But I cannot see the image on the dashboard. am i missing any steps?list the bucket, i can see objects being returned to the consolewrangler devenv insteadenv.BUCKET.get()?
export const action: ActionFunction = async ({ request, context }) => {
const formData = await request.formData();
const image = formData.get('image') as File;
if (!image) throw new Response("No image uploaded", { status: 400 });
const buffer = await image.arrayBuffer();
const { put } = context.cloudflare.env.BUCKET;
await put(image.name, buffer);
return new Response("OK", { status: 200 });
}ProxyStub { name: 'HeadResult', poisoned: false }listexport const loader: LoaderFunction = async ({ context }) => {
try {
const { env } = context.cloudflare;
const { objects } = await env.BUCKET.list();
return { objects };
} catch (e) {
console.log(e);
return new Response("Error", { status: 500 });
}
};env.BUCKET.get()const { put } = context.cloudflare.env.BUCKET;await context.cloudflare.env.BUCKET.put(image.name, buffer);