# Cloudflare R2 solution docs

- [Orphaned objects in R2: lifecycle rules and the sweep they cannot do](https://agenticboilerplate.com/cookbook/r2/cleaning-up-orphaned-uploads): Direct-to-bucket uploads leak objects nobody references. Lifecycle rules clean up a tmp/ prefix and abandoned multipart parts; owner-scoped orphans need a reconciliation job.
- [The R2 upload that fails in the browser and works in curl: bucket CORS](https://agenticboilerplate.com/cookbook/r2/cors-on-a-bucket): A presigned PUT from a page is a cross-origin request. Without CORS rules on the bucket it fails with an error that never says CORS, and the signature gets blamed.
- [Serving R2 objects publicly: custom domains, r2.dev and cache headers](https://agenticboilerplate.com/cookbook/r2/custom-domains-and-cache-headers): r2.dev is rate-limited and not for production. A custom domain puts Cloudflare's cache in front of the bucket, but only if you wrote Cache-Control at upload time.
- [Presigned PUT or multipart: picking an upload strategy for R2](https://agenticboilerplate.com/cookbook/r2/presigned-put-vs-multipart): A single presigned PUT is right up to about 100 MB and restarts from zero when it fails. Above that, multipart is not an optimisation, it is the only thing that works.
- [Zero egress fees, and the workloads where R2 actually beats S3](https://agenticboilerplate.com/cookbook/r2/zero-egress-and-when-r2-beats-s3): Egress is the line that surprises people on an S3 bill. R2 charges nothing for it and charges for operations instead: here is the arithmetic for deciding, including where R2 loses.

---

Agentic Boilerplate: A Next.js repo your agent already knows. Free during launch, then $99 once.

- Site map for agents: https://agenticboilerplate.com/llms.txt
- Public API: https://agenticboilerplate.com/openapi.json
- Contact: agenticstudio@gmail.com
