billflare.

Have a domain, don't buy a server yet: quota boundaries when using the Cloudflare free plan for DNS and going live

In an 𝕏 article on 2026-11-26, 𝕏 user Egg_2rich compiled a free-quota quick-reference table against what the author says is the 2026-11-26 Cloudflare documentation, and wrote several pitfalls: Workers Static Assets static requests do not consume the daily request quota, but the per-file limit is 25 MiB; do not set run_worker_first to true, or after Free is exceeded the related paths return 429 directly and do not fall back to static assets; the Free Worker per-invocation CPU limit is 10 ms; R2 egress is free, but Standard storage has free quotas of 10 GB-month, Class A 100 万次, Class B 1,000 万次, and others, and downloads through a Worker count toward the Workers Free daily request quota of 100,000 次.

Products
WorkersR2D1Email Routing
Source
Author experienceEgg_2rich 𝕏 article
Author
Egg_2rich

Key points

  • On 2026-11-26, author Egg_2rich published an 𝕏 article, "Have a domain, don't buy a server yet: a tutorial for individual developers using the Cloudflare free plan for DNS and going live." The article has a free-quota quick-reference table that the author labels as checked against the 2026-11-26 Cloudflare documentation. That table is missing from the body returned by the API and has been archived as an unlocated block, so article completeness cannot be marked complete.
  • On Workers Static Assets, the author writes: older tutorials often teach Pages, while new projects can use Workers Static Assets directly, with static files served from the edge and not consuming the daily request quota. Hard limits the author lists include a per-file cap of 25 MiB and 2 万文件 per version. The author warns not to set run_worker_first to true, and to give only the array of paths that need a script (for example ["/releases/*"]); the author says that after Free is exceeded, run_worker_first paths return 429 directly and will not fall back to static assets.
  • On Workers and D1, the author says the Free per-invocation CPU limit is 10 ms, and waiting on the network and waiting on the database do not count; complex auth, SSR, and parsing large data usually take 10–20 ms, which is already over the limit. In the author's table, the Workers free quota is 10 万次 per day (resets at UTC midnight), and over quota it is 1027 / 429. The D1 free quota is 500 万 reads and 10 万行 writes per day, counted by rows scanned; 5 GB total, 500 MB per database, and 10 库.
  • On R2, the author says egress is free, and the free quota applies only to Standard storage: 10 GB-month, Class A 100 万次, Class B 1,000 万次. The author also writes: do not use r2.dev as a production download link; it is only for non-production and is rate-limited; downloads through a Worker count toward the Workers Free daily request quota of 100,000 次, and after the quota is exceeded /releases/* returns 429 directly. The author says enabling R2 requires going through the checkout flow in the console to activate the subscription.

Original sources

  1. Published

    Original post

    Read on 𝕏

    In an 𝕏 article on 2026-11-26, 𝕏 user Egg_2rich compiled a free-quota quick-reference table against what the author says is the 2026-11-26 Cloudflare documentation, and wrote several pitfalls: Workers Static Assets static requests do not consume the daily request quota, but the per-file limit is 25 MiB; do not set run_worker_first to true, or after Free is exceeded the related paths return 429 directly and do not fall back to static assets; the Free Worker per-invocation CPU limit is 10 ms; R2 egress is free, but Standard storage has free quotas of 10 GB-month, Class A 100 万次, Class B 1,000 万次, and others, and downloads through a Worker count toward the Workers Free daily request quota of 100,000 次.

    Egg_2rich

    @Egg_2rich · Original 𝕏 post

    https://t.co/Vu9W075ble
    Read originalArchived

    Egg_2rich · @Egg_2rich

    This archive does not contain the complete text.

    有域名先不买服务器:个人开发者用 Cloudflare 免费方案做 DNS 与上线教程

    做小产品冷启动,最劝退的往往不是写功能,而是上线那一哆嗦。 页面刚写完,还没迎来第一个用户,就得先折腾服务器、配 HTTPS 证书、找地方塞几十 MB 的安装包,还得搞个像样的域名客服邮箱。 看清 Cloudflare 免费档能扛下的这些活,这哪是云服务商,简直是个人开发者的赛博菩萨。 只要手里已经有一个域名,官网托管、后端接口、数据库、安装包下载、定时任务、域名收信,这六件事全都可以先用 Cloudflare 免费方案跑通,先不急着买服务器。 拿一个真实在跑的 macOS 工具 NeverBanned 做参照(下面 NeverBanned 的信息来自公开检查和项目配置):看不到另一台源站,官网、接口和安装包都在 Cloudflare 上跑。 它 2.7.0 的安装包是 43.18 MiB(45,275,235 字节),和我的发版记录一致;2026-11-25 20:54(北京时间)是我发布 2.7.0 更新清单的时间。 先说清三件事: 可顺读,也可跳章。 目录按需求排,卡哪一步直接看哪一节。 不手写全套后端也能做完。 关键命令和配置给齐,业务代码给「带护栏提示词」,丢给 Claude Code 或 Codex 即可。 不吹全家桶,也不藏边界。 哪些需求必须老老实实上 VPS,最后说透。 目录 开工前准备:把本地工具连上 Cloudflare 一、先把域名接进来(DNS) 二、把官网挂上去,静态访问不烧额度(Workers Static Assets) 三、让产品查数据、吐更新清单(Workers + D1) 四、安装包超过 25 MiB 怎么发(R2) 五、让后台按点自动重试(Cron Triggers) 六、留个域名客服邮箱,分清收信和发信(Email Routing) 七、说句大实话:哪三种需求直接上 VPS 八、按当前卡点对号入座 先存好这张免费额度速查表(对照 2026-11-26 Cloudflare 文档): 开工前准备:把本地工具连上 Cloudflare 第 2 到第 5 章都要在本地敲命令,花三分钟把工具链连好。 先准备好 Cloudflare 账号、已注册域名,本地装好 Current、Active 或 Maintenance 维护周期内的 Node.js,终端跑 node -v && npm -v 确认有输出。 不用全局装 Wrangler,直接用脚手架建官网项目 my-site 并授权登录: 脚手架交互选 Hello World、JavaScript 即可。wrangler login 走 OAuth 授权,会拉起浏览器点确认;没自动弹出时,复制终端里的授权链接贴进浏览器就行。 后面几章都会改 wrangler.jsonc,记住三个基础字段: name:Worker 名称(下文官网统一用 my-site,接口用 my-api)。 compatibility_date:运行时兼容日期,填当天 YYYY-MM-DD(如 "2026-11-26")。 main:脚本入口(如 "src/index.js")。纯静态站点可省掉,有 Worker 代码必须填。 下文统一用 example.com 代指你的域名,实操时替换成自己的。 一、先把域名接进来,后面所有功能都挂在它上面(DNS) DNS 就是域名的通讯录。把权威解析切到 Cloudflare,后面挂官网、绑接口、开收信全在一套底座上顺着做。 4 步切完权威解析 进控制台 Domains → Onboard a domain,输入根域名(如 example.com,不带 https:// 或 www.),选快速扫描,套餐拉到底选 Free。 换 NS 前逐条核对导入记录。 快速扫描不保证扫全历史记录。打开原注册商后台,把现有的 A、AAAA、CNAME、MX、TXT 逐条对一遍。漏了哪条就手动补哪条。 先在原注册商关掉 DNSSEC。 没关 DNSSEC 就换 NS,校验链路一断,域名会直接打不开。等域名在 Cloudflare 变成 Active 后,再回到 Cloudflare 重新开启。 复制 Cloudflare 分配的两个 NS,去原注册商后台替换旧 NS,逐字符核对别多空格。 小云朵怎么点,记住三条边界 在 DNS → Records 里,橙云(Proxied)走 Cloudflare 代理(拿缓存、HTTPS 和基础防护),灰云(DNS only)只返回解析值。 只有 A、AAAA、CNAME 能开橙云。 MX 和 TXT 永远是 DNS only,没有开关;第三方验证用的 CNAME 也别开橙云。 别提前给 Worker 手动建 CNAME。 后面绑 Custom Domain 时,Cloudflare 会自动建 DNS 记录和证书;主机名若已有 CNAME,创建会直接失败。 Custom Domain 是精确匹配。 绑在 example.com 上收不到 www.example.com。想让 www 跳根域,先给 www 加一条橙云占位记录(如 A 192.0.2.0 或 AAAA 100::)。接着去配 Redirect Rule。 域名切到 Cloudflare DNS 之后,网页解析走橙云,后面的官网和接口 Worker 也都挂在这套底座上。 换完 NS 别急着往下部署,先用终端确认权威解析已经真正切过来了。 怎么验收 换 NS 最长可能要等 24 小时,以控制台变成 Active 且终端查到两个 NS 为准: Windows 没装 dig 就用 nslookup -type=ns example.com 1.1.1.1。返回的两个 NS 和控制台完全一致才算稳。 neverbanned.app 的 NS 在 Cloudflare,根域和 license.neverbanned.app 走代理;www.neverbanned.app 返回 NXDOMAIN,正好印证只绑根域不会带 www。 二、把官网挂上去,静态访问不烧额度(Workers Static Assets) 老教程常教你用 Pages,现在新项目直接用 Workers Static Assets 更顺:静态文件直接从边缘吐出、不耗每日请求额度,第 4 章加下载逻辑也不用搬家。 3 步推上正式域名 回到 my-site 目录,建一个 public 目录放最小测试页(Astro/Vite 等静态站直接把 directory 指向 ./dist/): 纯静态站点不写脚本,把 my-site/wrangler.jsonc 精简成这样(可省略 main): 先本地看一眼(http://localhost:8787),确认能打开后 Ctrl+C 停掉,执行部署: 账号第一次部署时,终端可能先让你注册一个 *.workers.dev 子域,注册完再部署才会给预览地址。 接着进 Workers & Pages → my-site → Settings → Domains & Routes → Add → Custom Domain,填入 example.com。 Cloudflare 会自动建 DNS 记录和证书,等控制台显示就绪后再用 HTTPS 打开。 官网的静态 HTML、CSS 和 JS 直接存在 Workers Static Assets 里,访客在边缘节点就能拿到文件。 不用自己维护一台常年开机的 Web 服务器,也不用惦记着给证书续期。 验收和三个避坑点 终端跑 curl -i https://example.com 看 200 和 My Product v1。再把 v1 改成 v2 重跑 npx wrangler deploy,确认线上变新,发版链路才算通。 单文件上限 25 MiB。 静态请求免费不限量,但超过 25 MiB 的安装包塞不进 public/,留给第 4 章 R2。 静态资产不支持断点续传。 对 Static Assets 发 Range 请求会返回完整文件的 200,不是 206,也没有 Content-Range / Accept-Ranges。 别把 run_worker_first 设成 true。 后面加脚本时,只填路径数组(如 ["/releases/*"])。这样不会让整站静态资源烧每日额度。Free 超额后,run_worker_first 路径直接返 429,不回退静态文件。 NeverBanned 的官网 Worker neverbanned-site 用 Workers Assets,只设 run_worker_first = ["/releases/*"],首页响应带 cf-cache-status: HIT。 三、让产品能查数据、吐出更新清单(Workers + D1) 做空间设计先分主动线,小产品上线也一样:把后端接口拆成独立 Worker,改接口不用重传官网,查日志也清爽。 1. 建接口项目和 D1 数据库 退回上一级目录,建独立项目 my-api(选 Hello World、JavaScript),再建 D1 库 my-app-db: 终端询问是否自动写入配置时选 Yes。打开 my-api/wrangler.jsonc,把 binding 统一改成 "DB": 2. 把建表 SQL 和接口代码交给 AI 不用在手机上抄几十行模板代码,直接把带护栏的提示词交给 Claude Code 或 Codex: 复制给 Claude Code / Codex 的提示词: 在 my-api 目录完成: 1. 建 schema.sql:建 releases(id, version, download_url, published_at) 表,published_at 用 ISO 8601 文本,给 published_at DESC 建索引,插一条 1.0.0 测试数据(https://example.com/releases/app.dmg)。 2. 写 src/index.js(用 env.DB):GET /healthz 查 SELECT 1 AS ok 返 {"ok":true};GET /v1/update/manifest 用 env.DB.prepare(...).first() 返最新版 JSON,并带上你设定的 Cache-Control(频繁更新的 JSON 用短缓存),查不到或其余路径返 404。 护栏:密钥不进代码;不自动部署;给出本地和远程(必带 --remote)执行 SQL 的命令。 3. 推远程库、部署、验证 先本地跑通 SQL,再加 --remote 执行到线上 D1,然后部署: 去控制台给 my-api 绑上 Custom Domain api.example.com。等控制台显示就绪后,跑三条验收命令: 确认 /healthz 返 200 与 {"ok":true},/v1/update/manifest 返 200 且 Cache-Control 与你在代码里设定的一致(频繁更新的 JSON 用短缓存),/nope 返 404。 客户端查更新时直接请求独立的接口 Worker,再由 Worker 查 D1 返回结果,和静态官网互不干扰。 有了一个公开的健康检查接口,后面随时跑一条命令就能确认服务是不是还活着。 三条必盯红线 线上执行 SQL 漏了 --remote。 不带 --remote 只改本地模拟库,部署后线上必报找不到表。 忘建索引把读行数烧穿。 D1 每天 500 万读行按扫描行数算,不是按返回行数算;查一次全表扫几千行就扣几千行,配额用完后查询直接报错。 往免费 Worker 里塞重逻辑。 Free 单次 CPU 上限 10 ms,等网络和等库不算在内。复杂鉴权、SSR、解析大数据通常要 10–20 ms,已经超限。接口务必保持轻薄。 NeverBanned 的接口 Worker 是 neverbanned-license-worker,绑 license.neverbanned.app,连 D1 neverbanned-license-db。 四、安装包超过 25 MiB 怎么发?放进对象存储(R2) 桌面端软件或大素材包很容易撞上 25 MiB 静态上限。 NeverBanned 2.7.0 的安装包是 43.18 MiB(45,275,235 字节),和我的发版记录一致(2026-11-26 01:06 北京时间公开检查 HEAD https://neverbanned.app/releases/NeverBanned-2.7.0.dmg,Content-Length: 45275235)。 43.18 MiB 放不进 Assets,它存在 R2 桶 neverbanned-releases,经官网 Worker 的 /releases/* 分发。 R2 出网免费,免费额度仅对 Standard 存储生效:10 GB-month、Class A 100 万次、Class B 1,000 万次。 1. 先开通 R2 订阅,再建桶上传 R2 不能凭空建桶,先去控制台 Storage & databases → R2 → Overview,走完结账流程给账号添加 R2 订阅。 开通后回终端建桶并上传安装包(假设当前目录有 app.dmg): 记住三个细节: 上传必带 --remote。 不加 --remote 只写本地模拟存储;线上遇到 404,先查两件事:上传时有没有带 --remote,以及 Worker 取的 key 和上传的对象名是否一致。 显式带上 --content-type。 例如 .zip 用 application/zip,免得下载缺类型。 注意单文件上限。 Wrangler 单文件上传上限 315 MB。 2. 挂在官网 /releases/* 路径下 切回 my-site 目录,更新 my-site/wrangler.jsonc,补上 main、ASSETS、run_worker_first 和 RELEASES 绑定: 接着把下载代理代码交给 AI 写: 复制给 Claude Code / Codex 的提示词: 在 my-site 建 src/index.js,用 ASSETS 和 RELEASES 实现: 1. /releases/* 路径先去掉 /releases/ 前缀,再 decodeURIComponent 得到 key(例如 /releases/app.dmg 对应 key app.dmg,必须和上传命令 r2 object put my-releases/<key> 中的对象名一致,如 my-releases/app.dmg),调 env.RELEASES.get(key),null 返 404;否则 object.writeHttpMetadata(headers) + etag: object.httpEtag 流式返回(需要断点续传再说明 range: request.headers 返 206)。 2. 其他路径交给 env.ASSETS.fetch(request)。 护栏:不动 ./public/,密钥不进代码;R2 上传命令必带 --remote 和 --content-type。 AI 写完后,对照下面这段参考实现核对: 写完后在 my-site 目录运行 npx wrangler deploy。 文件本体存在 R2 桶里,用户点下载链接时,由官网 Worker 按路径取出文件流送给浏览器。 普通页面依然直出 Static Assets 不走脚本,只有 /releases/* 经过 Worker,静态页和大包下载干干净净分开。 3. 验收别只看 HEAD 200 每次发版,用 GET 把线上文件完整下回来,核对状态码 200、Content-Type 以及字节数或 SHA-256: 两者一字不差,再切回 my-api 目录更新第 3 章的 D1 表 download_url(版本号和时间换成你自己的): 最后盯牢两条边界:别拿 r2.dev 当正式下载链接,它只用于非生产且有限速;经 Worker 的下载会计入 Workers Free 每天 100,000 次请求额度,超额后 /releases/* 直接返 429。 五、让后台按点自动重试,不用养常驻机器(Cron Triggers) 支付后补发邮件、漏推反馈重试、定期清理临时数据,用 Cron Triggers 到点唤醒 Worker 跑完即停,不用养常驻进程。 直接复用第 3 章的 my-api 项目和 env.DB。在 my-api/wrangler.jsonc 增加 triggers 字段(每 10 分钟一次): 铁律:Cron 全按 UTC 执行。 北京时间要减 8 小时,比如北京时间早上 09:00 对应 "0 1 * * *"。 让 AI 给 my-api/src/index.js 补 scheduled() 时,一定要卡死护栏,防止它覆盖掉第 3 章的 /healthz 和 /v1/update/manifest 路由: 复制给 Claude Code / Codex 的提示词: 先读 my-api/src/index.js,在 export default 中与 fetch() 并列加 async scheduled(controller, env, ctx),用 env.DB 按 LIMIT 分批查询并打印 controller.cron。 护栏:绝对不要删除或覆盖已有的 /healthz 和 /v1/update/manifest 路由;控在 10 ms CPU 内;密钥不进代码;不自动部署。 本地怎么验证? npx wrangler dev 不会按时间表自动跑 Cron。启动后另开终端手动触发: 看到定时日志打印出来,再跑 npx wrangler deploy 上线。上线后注意三条: 全球生效最长 15 分钟,这期间到点的任务可能漏跑,生效后从下一个计划时间开始跑。 只在配置文件改 Cron。 部署时只有配置里写了 crons 才会替换先前的 Cron,crons: [] 会全删;未定义 triggers/crons 则保留线上已部署的。 Free 上限:每账号 5 个 Cron,单次墙上时间 15 分钟,CPU 上限 10 ms。 NeverBanned 的 neverbanned-license-worker 就挂了一条 */10 * * * * 的 Cron,用来重试许可证邮件和反馈通知。 六、留一个域名客服邮箱,顺手分清收信和发信(Email Routing) 官网页脚留个 support@example.com 体面得多。只收来信并转到常用邮箱,Email Routing 免费入站不限量、单封上限 25 MiB。 动手前先把收信和发信拆成两条线: 收信走 Email Routing,转发到常用邮箱。 对外发信(发激活码、通知给陌生用户):Cloudflare 的 Email Sending 是 Beta,Free 计划只能发给账号里已验证的地址。走免费方案给外部用户发信,另接第三方发信服务(如 Resend)。 3 步开通收信(需已用 Cloudflare DNS) 控制台进 Compute → Email Service → Email Routing → Onboard Domain,选 example.com,确认自动添加的 MX、SPF、DKIM 记录。这些 DNS 变更通常 5–15 分钟生效,最长 24 小时。 进 Destination Addresses,填你的常用邮箱,去收件箱点验证链接。 进 Routing Rules → Create routing rule,前缀填 support,动作选 Send to an email,目标选刚验证的邮箱,保存。 外部发往域名的来信走 Email Routing 转发到你的收件箱,产品给用户发激活码和通知信则走独立的发信通道。 把「收」和「发」拆成两条线,配 DNS 记录就不会把两边的 SPF 和 DKIM 搅成一团。 验收与发信 DNS 避坑 终端先查 MX 和 SPF 是否到位: 接着发真实测试信:一定要用另一个不同的邮箱账号发。用目标邮箱自发自收,很多邮件服务商会直接静默丢弃;没收到时顺手翻一下垃圾箱。 接第三方发信服务时,DNS 记录照服务商后台给的值添加(Resend 的 SPF 和 MX 默认在 send 子域,DKIM 在 resend._domainkey)。同一主机名只能有一条 v=spf1,要加到已有 SPF 的主机名上就合并进同一条,再补一条 DMARC。 NeverBanned 的 DNS 里能看到 Email Routing 的 MX、SPF、DKIM,对外发信走 Resend(没用 Email Sending)。Resend 的 SPF 在 send 子域,DKIM 在 resend._domainkey,目前还缺一条 DMARC。 七、说句大实话:哪三种需求别硬拗,直接上 VPS 前面六章跑完,小产品的核心链路已经齐活。但说句大实话,碰到这三种需求,别在免费方案里硬拗,直接上 VPS: 需要固定专属出口 IP。 对接支付或白名单接口时常见。普通全局 fetch() 不走 Gateway。要专属出口 IP,需经 Workers VPC(Beta) 的 cf1:network 绑定转 Cloudflare Gateway。而且专属出口 IP 属于 Zero Trust Enterprise 附加项。个人项目直接用 VPS。 需要 24 小时常驻进程。 Workers 按事件唤醒、跑完就放,Cron 单次墙上时间最多 15 分钟,接不住常驻长连接或后台守护进程。 重计算任务。 Free 单次 CPU 只有 10 ms,鉴权、SSR、解析大载荷常跑到 10–20 ms;音视频转码、大图批处理直接放 VPS。 把适合无服务器的轻活交给 Workers、D1 和 R2,把固定出口、常驻进程和重计算留给 VPS,架构就不会反复推倒重来。 小产品前期最怕的不是功能不够多,而是还没迎来第一批用户,先把整套运维复杂度拉满。 从 NeverBanned 也能看出这种克制:Pages、KV、Email Sending、Turnstile、自定义 WAF、Workers AI、AI Gateway、AI Search、Tunnel、Access 这些在项目配置里都看不到。用不到就先不点,保持配置清爽,维护才省心。 八、按你现在卡在哪一步,挑一节直接开始 按你眼前的需求对号入座,一次只做一章: 习惯用 Claude Code 或 Codex 改项目的话,每次动 Cloudflare 前先把这段通用护栏提示词贴给它: 交给 AI 动 Cloudflare 前的通用护栏: 修改前先读取现有 wrangler.jsonc 和 src/index.js,不得覆盖已有路由和绑定名(ASSETS、DB、RELEASES)。 1. 远程 D1 / R2 命令必带 --remote,上传 R2 必带 --content-type。 2. 禁止把任何密钥写进代码或前端文件。 3. 不要自动部署或改 DNS,改完先列改动摘要和验证命令,确认后再执行。 先把主链路干干净净跑通,做完一章、亲自验证通过一章,再开下一章。 你现在的项目,卡在第几章?

    These source blocks are preserved as an appendix without changing the article text.

    Appendix 1 · sh

    ```sh
    curl -i https://api.example.com/healthz
    curl -i https://api.example.com/v1/update/manifest
    curl -i https://api.example.com/nope
    ```

    Appendix 2 · sh

    ```sh
    npx wrangler d1 execute my-app-db --remote --command "INSERT INTO releases (version, download_url, published_at) VALUES ('1.0.1', 'https://example.com/releases/app.dmg', '2026-11-27T00:00:00Z');"
    ```

    Appendix 3 · sh

    ```sh
    dig mx example.com @1.1.1.1 +short
    dig txt example.com @1.1.1.1 +short
    ```

    Appendix 4 · sh

    ```sh
    dig ns example.com @1.1.1.1 +short
    ```

    Appendix 5 · jsonc

    ```jsonc
    {
      "name": "my-site",
      "main": "src/index.js",
      "compatibility_date": "2026-11-26",
      "assets": {
        "directory": "./public/",
        "binding": "ASSETS",
        "run_worker_first": ["/releases/*"]
      },
      "r2_buckets": [
        {
          "binding": "RELEASES",
          "bucket_name": "my-releases"
        }
      ]
    }
    ```

    Appendix 6 · sh

    ```sh
    npx wrangler d1 execute my-app-db --local --file=./schema.sql
    npx wrangler d1 execute my-app-db --remote --file=./schema.sql
    npx wrangler deploy
    ```

    Appendix 7 · sh

    ```sh
    cd ..
    npm create cloudflare@latest -- my-api
    cd my-api
    npx wrangler d1 create my-app-db
    ```

    Appendix 8 · js

    ```js
    export default {
      async fetch(request, env) {
        const { pathname } = new URL(request.url);
        if (pathname.startsWith("/releases/")) {
          const key = decodeURIComponent(pathname.slice("/releases/".length));
          const object = await env.RELEASES.get(key);
          if (object === null) return new Response("Not Found", { status: 404 });
          const headers = new Headers();
          object.writeHttpMetadata(headers);
          headers.set("etag", object.httpEtag);
          return new Response(object.body, { headers });
        }
        return env.ASSETS.fetch(request);
      },
    };
    ```

    Appendix 9 · sh

    ```sh
    mkdir -p public
    printf '<!doctype html><meta charset="utf-8"><h1>My Product v1</h1>\n' > public/index.html
    ```

    Appendix 10 · jsonc

    ```jsonc
    {
      "name": "my-api",
      "main": "src/index.js",
      "compatibility_date": "2026-11-26",
      "d1_databases": [
        {
          "binding": "DB",
          "database_name": "my-app-db",
          "database_id": "<替换成建库输出里的真实 database_id>"
        }
      ]
    }
    ```

    Appendix 11 · sh

    ```sh
    curl "http://localhost:8787/cdn-cgi/local/scheduled"
    ```

    Appendix 12 · jsonc

    ```jsonc
    {
      "name": "my-site",
      "compatibility_date": "2026-11-26",
      "assets": {
        "directory": "./public/"
      }
    }
    ```

    Appendix 13 · none

    | 组件 | 用途 | 免费额度 | 核心硬限制 |
    |---|---|---|---|
    | **Static Assets** | 静态官网 | 请求不限量、存储不另收费 | 单文件 **25 MiB**,每版 2 万文件 |
    | **Workers** | 轻接口 / 代理 | **10 万次/天**(UTC 零点重置) | **10 ms CPU**,超额 1027 / 429 |
    | **D1** | 更新清单、业务表 | 读 **500 万**/写 **10 万行**(日) | 按**扫描行**算;总 5 GB、单库 500 MB、10 库 |
    | **R2** | 安装包、大文件 | Standard **10 GB-month**、A 100 万/B 1,000 万、**出网免费** | 需控制台走结账流程开通订阅 |
    | **Cron Triggers** | 定时重试 | 每账号 **5 个**、墙上 **15 分钟** | 按 **UTC** 跑,CPU 10 ms |
    | **Email Routing** | 域名收信 | 入站**不限量**,单封 **25 MiB** | 只管收信;Email Sending(Beta)Free 仅发已验证地址 |

    Appendix 14 · none

    | 你现在的情况 | 先看哪几章 | 跑通标准 |
    |---|---|---|
    | 有域名,先挂出官网 | 准备 + 一 + 二 | `dig ns` 生效,改字重发线上变新 |
    | 要发 >25 MiB 安装包 | 一 + 二 + 四 | GET 完整下载,字节数或 SHA-256 一致 |
    | 要加接口、查库和定时重试 | 准备 + 三 + 五 | `/healthz` 200、清单的 `Cache-Control` 与设定一致、本地 Cron 敲通 |
    | 只想留域名客服邮箱 | 一 + 六 | 用第二个邮箱发信,常用邮箱实收无误 |

    Appendix 15 · sh

    ```sh
    npx wrangler r2 bucket create my-releases
    npx wrangler r2 bucket list
    npx wrangler r2 object put my-releases/app.dmg --file=./app.dmg --content-type=application/x-apple-diskimage --remote
    ```

    Appendix 16 · jsonc

    ```jsonc
      "triggers": {
        "crons": ["*/10 * * * *"]
      }
    ```

    Appendix 17 · sh

    ```sh
    npm create cloudflare@latest -- my-site
    cd my-site
    npx wrangler login
    ```

    Appendix 18 · sh

    ```sh
    curl -D - -o downloaded.dmg https://example.com/releases/app.dmg
    wc -c ./app.dmg ./downloaded.dmg
    shasum -a 256 ./app.dmg ./downloaded.dmg
    ```

    Appendix 19 · sh

    ```sh
    npx wrangler dev
    npx wrangler deploy
    ```
Author experienceWorkers +2

devopsdom: a viral Minecraft-on-Cloudflare repo still has a $25 to $30/mo floor once you read the README pricing

On 2026-11-25, X user devopsdom wrote that a viral repository running Minecraft Java on Cloudflare looks inexpensive until you read the README pricing: Workers Paid $5/mo; a Pro zone because Spectrum needs Pro, $25/mo ($20 yearly); and a Container of about $5/mo at 2h/day, or $40 to $90 always-on. The author concludes there is a $25 to $30/mo floor before one player joins. These figures are the author’s reading of that project’s README, not a general Cloudflare price list.

D1

Jay (@Cyberlane): a $513.20 D1 bill for two small personal databases; Cloudflare confirms a refund.

Jay (@Cyberlane) says two small D1 databases used only by himself for two little apps produced a bill of over $500 for reads and writes. He later quotes the invoice: 452,256,462 rows written ($453) and 60,197,421,138 rows read ($60.20) for Sep 17 – Oct 16, a D1 total of $513.20 before tax. Tyson Trautmann, whose profile lists Storage & Databases at Cloudflare, replies publicly and loops in the D1 engineering team.

Author experienceDurable Objects +2

Anti-abuse code that burned the Durable Objects allowance: heartbeats, rejected requests and D1 scans

Frank Zeng (@frankzeng2020) says an AI-written anti-abuse module pushed Durable Objects to 1.19 million requests against the 1 million included each month, costing him an extra $0.15; a budget alert email caught it, and the audit also found a D1 query path scanning 925 million rows a day and a signing key re-imported on every request. He shares a read-only self-audit prompt.