There is no cost crossover, because Cloudflare Cache is free and Class B is free below 10 million reads a month — the first $0.36 arrives at 10,000,001 downloads, about four orders of magnitude above anything Scribble Works does
The question
Verbatim as filed:
"What's the real monthly-download crossover where R2 Class B operations cost more than putting Cloudflare Cache in front of the paper-playground PDF bucket?"
Context: this is the flagged-but-unresolved open question from [[2026-10-10-binary-run-output-accumulation-storage-patterns]], which recommended artifact-store-only on R2 and then listed the Scribble Works serving economics as a desk calculation it had not done. The answer below is that arithmetic.
What we already know (from the vault)
- The question's premise about the serving path is wrong in a way that changes the answer. Parents do not hit R2 directly.
functions/api/pdf/[slug].jsis a same-origin proxy: it validates the slug againstCATALOG.games, then server-sidefetcheshttps://pub-02c63857bb134defb5f26e6d81665568.r2.dev/games/<slug>.pdfand streams the body back withcache-control: public, max-age=3600. Its own header comment gives the reason: the Pages project "intentionally has no R2 binding (wrangler.toml documents that Pages Functions + R2 broke deploys)". So every download is one Pages Function invocation plus one R2GetObject, and the Function hop has its own meter ([[2026-09-06-scribble-works-onboarding-review-grok]]; [[pages-r2-binding-breaks-function-publish]] records the original incident). - The bucket is exposed through the
r2.devPublic Development URL, not a custom domain. That is the whole reason there is nothing to compute a "with cache" column against today: Cloudflare Cache is not available onr2.devat all. A 2026-09-06 fresh-eyes review already called this out as an architecture smell rather than a cost problem: "publicr2.devis a development endpoint with variable rate limits, not an ideal production PDF origin" ([[2026-09-06-scribble-works-onboarding-review-astra]]). - The measured inputs are in the repo, so two of the three assumptions do not need to be guessed.
content/printables.manifest.jsoncarriessizeandsha256per object: 43 live printables (the queue note's "31+" is stale), 6.53 MB total, mean 151.9 KB, median 133.3 KB, range 75.2 KB to 538.4 KB.CATALOG.games.lengthis 43, matching. This is the committed byte-size manifest the parent brief recommended, already doing useful work. - The account is on Workers Paid, verified. "Workers Paid is already active (verified 2026-09-12, active since 2026-08-20)" ([[2026-08-31-studio-charter]]). This matters more than it looks: it removes a hard 100,000-requests-per-day wall that would have broken PDF downloads long before any R2 bill appeared, and replaces it with a linear meter.
- We have no traffic measurement, and the vault says so in its own words. The 2026-09-02 audit logged the download counter as "HALF DONE" and the 2026-09-01 synthesis recorded "zero instrumentation; the kill criterion cannot be measured today" ([[d-execution-vs-vision]]; [[2026-09-01-fresh-eyes-audit-synthesis]]). Every downloads-per-month figure below is therefore a plugged assumption, not a measurement.
What the web says
- R2 Standard: Class B operations are $0.36 per million, with 10 million per month free; egress is free. Confirmed against the live page, last updated 2026-10-01: Storage $0.015/GB-month, Class A $4.50/million, Class B $0.36/million, "Egress (data transfer to Internet) Free". Free tier is 10 GB-month storage, 1 million Class A, 10 million Class B. The egress footnote holds and is specific: egressing from R2 directly, through the Workers API, the S3 API, or
r2.devdomains incurs no egress charge, with the caveat "If you connect other metered services to an R2 bucket, you may be charged by those services" (developers.cloudflare.com/r2/pricing, read 2026-10-15). - A PDF download is exactly one Class B operation, and
GetObjectis named in the list. Class B is enumerated as HeadBucket, HeadObject, GetObject, UsageSummary, GetBucketEncryption, GetBucketLocation, GetBucketCors, GetBucketLifecycleConfiguration. NoteHeadObjectsits alongsideGetObject: the Function implementsonRequestHead, so a client that HEADs then GETs bills two Class B operations for one download (same source). - Billing rounds up to the whole million, which makes the bill a step function. "Cloudflare rounds up your usage to the next billing unit... If you have performed one million and one operations, you will be billed for two million operations." You cannot be charged four cents. The smallest non-zero Class B line item is $0.36 (same source).
- Cloudflare Cache publishes no usage price, and the one metered cache product is explicitly unavailable for this bucket. Caching on an R2 custom domain is described as a capability, not a SKU: "Domain access through a custom domain allows you to use Cloudflare Cache to accelerate access to your R2 bucket" (developers.cloudflare.com/r2/buckets/public-buckets, updated 2026-09-25). Cache Reserve is the only cache feature with a price table ($0.015/GB-month, Class A $4.50/million, Class B $0.36/million) and it is ruled out here by name: "Requests to R2 public buckets linked to a zone's domain will not use Cache Reserve" (developers.cloudflare.com/cache/advanced-configuration/cache-reserve).
- Cache is unavailable on
r2.dev, so the current configuration is structurally 100% origin reads. "To enable access management, cache, and bot management features, you must set up a custom domain when enabling public access to your bucket... These capabilities are not available when using ther2.devdevelopment url," plus "Public access throughr2.devsubdomains is rate-limited and should only be used for development purposes" (public-buckets, same page). - PDF is already a default-cached extension, so the custom-domain move needs no Cache Rule.
PDFappears in the default cached file extensions table; default Edge TTL for a 200 with no cache-control header is 120 minutes. Minimum configurable Edge Cache TTL is 2 hours on Free and 1 hour on Pro, which is worth knowing because the Function currently advertisesmax-age=3600(default-cache-behavior; edge-browser-cache-ttl). - The Pages Function hop costs $0.30 per million requests after 10 million included, at a $5/month account floor. "Requests to your Functions are billed as Cloudflare Workers requests." Workers Paid Standard: 10 million requests included then $0.30/million, 30 million CPU-ms included then $0.02/million CPU-ms, $5/month minimum, and "There are no additional charges for data transfer (egress) or throughput (bandwidth)" (pages/functions/pricing; workers/platform/pricing, read 2026-10-15).
- The "unauthorized requests are free" FAQ does not protect a public bucket. The answer is "No... You are not charged for operations when the caller does not have permission to make the request," scoped to HTTP 401. A public bucket answers a stranger's GET with a 200, so scraper traffic is billable Class B (r2/pricing FAQ).
Convergences and contradictions
- Convergence, and it is the finding: the vault's recorded architecture (
r2.dev, no cache, Function proxy) and Cloudflare's published prices agree that today's configuration is the maximum-Class-B configuration available, and that it still bills $0.00. The parent brief was right to flag the question and wrong to expect a crossover number to fall out of it. - Contradiction with the question's framing: the question assumes two priced alternatives. There is only one. Cloudflare Cache on a custom domain has no usage price, Cache Reserve is excluded by documented policy for zone-linked R2 public buckets, and cache hits never reach the bucket, so they cannot generate Class B operations. Cache weakly dominates on dollars at every volume. The honest reframe is "at what volume does the uncached path start to bill," not "where do the two curves cross."
- Tension worth naming: the binding constraint on
r2.devis availability, not cost. Cloudflare says the endpoint is rate-limited and non-production but publishes no number, so the real ceiling is an unknown that arrives before the $0.36 does, and it arrives as a 429 rather than an invoice.
Synthesis for RDCO
The arithmetic. Let D = PDF downloads per month and h = cache hit ratio. Origin reads are D x (1 - h). Because R2 rounds up to the whole million and forgives the first ten:
billable_millions = max(0, ceil( D x (1-h) / 1,000,000 ) - 10)
class_b_cost = billable_millions x $0.36
Assumptions plugged in, all labelled: avg PDF 151.9 KB (measured from the manifest, so this one is real); one GetObject per cache miss; no HEAD-then-GET doubling; no bot traffic. D is pure assumption, swept across four orders of magnitude because we have no counter.
| downloads/mo | h=0% | h=70% | h=90% | h=95% | h=99% | egress |
|---|---|---|---|---|---|---|
| 10,000 | $0.00 | $0.00 | $0.00 | $0.00 | $0.00 | 2 GB |
| 100,000 | $0.00 | $0.00 | $0.00 | $0.00 | $0.00 | 15 GB |
| 1,000,000 | $0.00 | $0.00 | $0.00 | $0.00 | $0.00 | 0.15 TB |
| 10,000,000 | $0.00 | $0.00 | $0.00 | $0.00 | $0.00 | 1.5 TB |
| 30,000,000 | $7.20 | $0.00 | $0.00 | $0.00 | $0.00 | 4.6 TB |
| 100,000,000 | $32.40 | $7.56 | $0.00 | $0.00 | $0.00 | 15 TB |
| 300,000,000 | $104.40 | $29.16 | $7.20 | $2.16 | $0.00 | 46 TB |
| 1,000,000,000 | $356.40 | $104.76 | $32.40 | $14.76 | $0.36 | 152 TB |
Egress is free at every row, which is why a column that reaches 152 TB can be ignored. The volume at which the bill first turns non-zero is 10,000,000 / (1 - h): 10.0M downloads/month uncached, 33.3M at a 70% hit ratio, 100M at 90%, 200M at 95%, 1.0B at 99%. Storage never enters the picture: 43 objects at 151.9 KB is 6.53 MB, rounding to 1 GB-month against a 10 GB-month free tier, and would not bill until roughly 65,800 printables of this size.
The honest magnitude. At Scribble Works' plausible traffic this is not pennies a month, it is exactly zero, and the crossover sits about four orders of magnitude above current volume. 10 million downloads a month across 43 printables is roughly 232,000 downloads per title per month, about 7,700 site downloads a day, sustained. Even if that happened, the uncached bill would be $0.36. Even at a hundred times today's most optimistic guess the answer does not change, because the step function cannot produce a number between $0.00 and $0.36. Configuring a cache layer purely to avoid Class B charges is not worth an hour of anyone's time, and that is the answer the parent brief's open question was asking for.
Where the real money and the real risk actually are, which is the part worth carrying forward. Three things outrank Class B and two of them are not dollar-denominated. First, the Pages Function hop is the larger meter and cache in front of R2 does not remove it: Workers run ahead of the zone cache, so /api/pdf/<slug> invokes the Function on every eyeball request whether or not the PDF is cached, at $0.30/million after a 10-million allowance that is shared account-wide with quick-sites, the review portal, HQ and the other Scribble Works APIs. At 100M downloads that is $27.00 of Workers requests against $32.40 of Class B. Only moving the download link off the Function path onto a custom-domain R2 URL removes it, and that reopens the same-origin and CORS reasons the proxy exists ([[2026-09-01-fresh-eyes-audit-synthesis]] records the CORS failure mode). Second, r2.dev is documented as rate-limited and non-production, and Cloudflare publishes no threshold, so the first real failure is a throttled download on a traffic spike, not a line on an invoice. Third, a public bucket pays for strangers: the 401 exemption does not apply, and r2.dev has no WAF and no Bot Management, so a scraper loop can manufacture Class B operations with nothing in the path to stop it. A custom domain is the move that makes WAF, Bot Management and cache available at once.
So the recommendation is to connect a custom domain, and to not do it for cost reasons. It is free in usage terms, PDF already caches by default so no Cache Rule is required, and it converts three open risks (rate limiting, unfilterable bot reads, no cache) into managed ones. Do it when the production-hardening ticket comes up, not as a cost action. Two non-obvious cliffs to carry into that ticket: Cache Reserve is unavailable by documented policy for R2 public buckets linked to a zone, so do not budget for it; and cache is per-colocation, so at low global volume with a 1-to-2-hour Edge TTL the realised hit ratio can sit well below the 90% the table assumes, which is another reason the cache's value here is operational rather than financial. Smart Tiered Cache is the documented fix for that and its plan availability was not verified in this pass.
Why this is in the vault
It closes the specific open question [[2026-10-10-binary-run-output-accumulation-storage-patterns]] left unresolved about the paper-playground bucket, and it changes the Scribble Works production-hardening decision from a cost optimisation into a reliability-and-abuse one, with a re-runnable formula so a future traffic number can be dropped in without redoing the research. It also pre-empts the recurring temptation to spend build time on a cache layer that cannot save money at this scale.
Open follow-ups
- What is the actual monthly download volume?
functions/api/downloads.jsalready has anincrement()counter that the 2026-09-02 audit logged as half done. Reading it once would replace the entire assumption sweep above with a measurement. - Does the Pages Function response at
/api/pdf/<slug>get cached by the zone at all? The path carries no file extension, and Workers run ahead of cache. One pair of curls readingcf-cache-statussettles whether themax-age=3600the Function advertises is doing anything, and it is the single highest-value cheap check here. - How much of the account-wide 10-million Workers request allowance is already consumed by quick-sites, the review portal, HQ and the other Scribble Works Functions? That allowance, not Class B, is the first meter Scribble Works growth will actually push on.
- Where does the undocumented
r2.devrate limit actually bite? Cloudflare publishes no number. A load test against a non-production bucket would convert the real production ceiling from unknown to known. - Would serving downloads from a custom-domain R2 URL break the same-origin design the proxy was built for, and does exposing the bucket's own hostname leak the object namespace for unpublished or pre-release printables? The Function's slug allowlist against
CATALOG.gamesis currently the publication gate, and a direct bucket URL has no equivalent.
Related
- [[2026-10-10-binary-run-output-accumulation-storage-patterns]]
- [[2026-09-07-scribble-works-process-map]]
- [[2026-09-06-scribble-works-onboarding-review-grok]]
- [[2026-09-06-scribble-works-onboarding-review-astra]]
- [[2026-09-01-fresh-eyes-audit-synthesis]]
- [[d-execution-vs-vision]]
- [[a-architecture-code-quality]]
- [[2026-08-31-studio-charter]]
- [[2026-09-06-review-portal-spec]]
- [[pages-r2-binding-breaks-function-publish]]
Sources
Vault:
~/rdco-vault/06-reference/research/2026-10-10-binary-run-output-accumulation-storage-patterns.md— the parent brief; open question verbatim at line 76~/rdco-vault/01-projects/printables-product/2026-09-06-scribble-works-onboarding-review-grok.md— no R2 binding on Pages, PDFs proxied from the public R2 URL~/rdco-vault/01-projects/printables-product/2026-09-06-scribble-works-onboarding-review-astra.md—r2.devas a development endpoint with variable rate limits~/rdco-vault/01-projects/printables-product/2026-08-31-studio-charter.md— "Workers Paid is already active (verified 2026-09-12, active since 2026-08-20)"~/rdco-vault/01-projects/printables-product/audit-2026-09-02/d-execution-vs-vision.md— download counter "HALF DONE"~/rdco-vault/01-projects/printables-product/2026-09-01-fresh-eyes-audit-synthesis.md— zero instrumentation; apex CORS failure mode~/rdco-vault/02-sops/2026-09-07-scribble-works-process-map.md—paper-playgroundas the printable store~/rdco-vault/01-projects/printables-product/2026-09-06-review-portal-spec.md—CATALOG_R2_BASEas the public read-only bucket URL
Code read directly (measurements, not assumptions):
/Users/ray/Projects/scribble-works/functions/api/pdf/[slug].js—R2_PUBLIC_BASE = 'https://pub-02c63857bb134defb5f26e6d81665568.r2.dev',CACHE_CONTROL = 'public, max-age=3600', GET and HEAD handlers/Users/ray/Projects/scribble-works/content/printables.manifest.json— 43 objects, 6.53 MB total, mean 151.9 KB, median 133.3 KB, range 75.2–538.4 KB/Users/ray/Projects/scribble-works/src/data/shopper-catalog.js—CATALOG.games.length= 43
Web (all read 2026-10-15):
- https://developers.cloudflare.com/r2/pricing/ (page last updated 2026-10-01) — Class B $0.36/million, 10 million/month free, egress free with footnote, Class B operation list, rounding rule, unauthorized-request FAQ scoped to HTTP 401
- https://developers.cloudflare.com/r2/buckets/public-buckets/ (updated 2026-09-25) — cache, WAF and Bot Management require a custom domain and are unavailable on
r2.dev;r2.devrate-limited and development-only; custom-domain caching via Cloudflare Cache - https://developers.cloudflare.com/cache/advanced-configuration/cache-reserve/ — Cache Reserve price table, and "Requests to R2 public buckets linked to a zone's domain will not use Cache Reserve"
- https://developers.cloudflare.com/cache/concepts/default-cache-behavior/ — PDF in the default cached file extensions; 120-minute default Edge TTL for 200
- https://developers.cloudflare.com/cache/how-to/edge-browser-cache-ttl/ — minimum Edge Cache TTL 2 hours Free, 1 hour Pro
- https://developers.cloudflare.com/pages/functions/pricing/ (updated 2026-09-08) — Pages Functions billed as Workers requests; static assets free and unlimited
- https://developers.cloudflare.com/workers/platform/pricing/ (updated 2026-10-02) — Standard model: 10M requests + 30M CPU-ms included, $0.30/million requests, $0.02/million CPU-ms, $5/month minimum, no egress charge
- https://developers.cloudflare.com/workers/platform/limits/ — Workers Free 100,000 requests/day (not binding here; account is on Paid)
Paywalls hit: none.