Public R2 bucket serve from server if file doesn't exist

We would like to use a public R2 bucket to store image files. These images will be generated on-the-fly but we would like to use R2 to store them after generation.

Is it possible to somehow set up a public R2 bucket to fall back to our server when the file doesn’t exist yet?

R2 does not have a fallback feature. You would have to create a worker that would handle the fallback. Something like GitHub - kotx/render: Cloudflare Worker to proxy and cache requests to R2

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.