patterns.md

Created about 12 hours ago

attributes
source_pathreferences/r2/patterns.md
source_sha256ecc1b176ea100388d8a273b277efa26bfdbe8996afed43715ab1788dd9a0d667
source_urlhttps://github.com/cloudflare/skills/blob/47dfc2ce969bf62acf8bc231198ade4bb02712e0/skills/cloudflare/references/r2/patterns.md
supporting_skill_id40184
upstream_revision47dfc2ce969bf62acf8bc231198ade4bb02712e0

R2 Patterns & Best Practices

Choose the access and delivery model, then fetch the implementation guide.

Task Current documentation
Stream object downloads or accept uploads through a Worker Use R2 from Workers
Add conditional reads/writes, range handling, checksums, or batch deletion Workers API reference
Upload large files with multipart state tracked by the client Multipart Worker and client example
Upload directly from a browser or share a temporary download Presigned URLs and CORS
Cache responses served by a Worker Cache API example
Deliver public objects through a custom domain or evaluate r2.dev Public buckets
Process object changes asynchronously Event notifications and Queues
Expire objects or transition storage classes Object lifecycles and storage classes

Authorize the caller for the selected object key and operation before exposing a Worker endpoint or issuing a presigned URL. A key-format check alone does not establish access rights. Set the intended expiry and signed request constraints for temporary access; configure browser CORS separately.

Keep private responses out of shared public caches. Choose cache keys and invalidation around the application's access model, and check R2 consistency and caching behavior when objects can change. For multipart uploads, plan for failed parts, completion, and cleanup using the linked guide.

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.