06-reference/research

r2 class b cloudflare cache crossover

2026-10-15·research-brief·source: deep-research·by Ray Data Co (deep-research synthesis)
cloudflare-r2cloudflare-cacheunit-economicsscribble-workscost-modeling

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)

What the web says

Convergences and contradictions

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

Related

Sources

Vault:

Code read directly (measurements, not assumptions):

Web (all read 2026-10-15):

Paywalls hit: none.