Hefe: choosing a Next.js host before the bill arrives, Vercel vs Cloudflare Workers vs VPS vs AWS
@chhefeng's X article compares five ways to deploy a Next.js site (Vercel, Cloudflare Workers via OpenNext, Railway/Render, VPS + Coolify, AWS + OpenNext/SST) by fit, real cost and operational burden, warns against predicting today's bill from old price tables, and ends with five cost-saving habits; prices were checked on November 8, 2026.
- Products
- Workers
- Source
- Author experience𝕏 article
- Author
- Hefe
Key points
- On Cloudflare Workers the article says there is no Workers egress fee and the paid plan starts at $5/month, but requests and CPU are still metered and databases, storage and image services may bill separately — '$5 is a starting point, not a cap for the whole site'.
- Before migrating via the OpenNext adapter it says to check the Next.js version and features, third-party libraries, and login, images and cache revalidation; a successful build is only the first step, and cross-continent database round trips can still be the bottleneck.
- General advice: configure spend alerts at launch and watch real usage; cache what can be cached, fix image sizes first, keep the app near its database, optimise from the real bill, and test the whole flow before migrating rather than moving at a fixed traffic or bill threshold.
Original sources
Published
Original post
Read on 𝕏@chhefeng's X article compares five ways to deploy a Next.js site (Vercel, Cloudflare Workers via OpenNext, Railway/Render, VPS + Coolify, AWS + OpenNext/SST) by fit, real cost and operational burden, warns against predicting today's bill from old price tables, and ends with five cost-saving habits; prices were checked on November 8, 2026.
Hefe
@chhefeng · Original 𝕏 post
用 AI 写完网站,部署平台该怎么选?对比 Vercel、Cloudflare Workers、Railway/Render、VPS + Coolify、AWS + OpenNext 五种方案的适用场景、真实成本和运维负担,附一张"直接照着选"对照表和 5 条省钱建议。 https://t.co/7Myip25dTx
Read originalArchived
Hefe · @chhefeng
Next.js 部署怎么选?别等账单来了,才发现选错了 (建议收藏)
用 AI 写完一个网站,下一步通常就是:部署上线。 搜索一圈,答案五花八门: “Next.js 就该用 Vercel。” “Cloudflare 便宜,直接冲。” “买台服务器,每个月几十块就够了。” 这些说法都有适用条件。选部署平台,关键看三件事:网站需要什么功能、你愿意花多少钱、愿意管多少事。 01|先搞清楚:你的网站需要服务器吗? Next.js 做出来的网站,大致可以分成两类。 第一类:提前做好的页面。 比如作品集、产品介绍页、部分博客。构建时生成 HTML、CSS 和 JavaScript,用户访问时直接读取文件。 这类项目如果能使用静态导出,就可以放到静态托管平台,通常成本很低。但静态导出无法承接需要服务器执行的功能,例如按请求生成页面、Server Actions 等。 第二类:访问时还要现场处理。 比如根据登录账号显示内容、在服务端查询数据库、处理表单。 这类项目需要服务端运行环境。 还有一种常见做法叫 ISR:先把页面缓存起来,需要时再更新,兼顾访问速度和内容新鲜度。 所以,选平台前先问一句: 我的项目,究竟需要多少服务端能力? 02|Vercel:想快速上线,先看它 可以把 Vercel 理解为“帮你安排好部署流程的平台”。 连接代码仓库后,提交代码就能自动构建、部署,还能生成预览地址,方便检查改动。 它最吸引人的地方是:你可以少花时间研究部署,多花时间做产品。 适合: 第一次部署 Next.js。 独立开发者验证新产品。 经常改页面,需要预览和快速发布的团队。 费用方面,官方目前展示 Pro 为 20 美元/月起,包含一定使用额度;具体还要看团队配置和资源用量。免费 Hobby 有使用条款限制,商业项目应先核对。 这里有个特别容易踩的坑: 别拿旧文章里的价格表,直接预测今天的账单。 例如,目前官方价格页已经列出 Flat Rate CDN,原先常见的“超过 1 TB 就按固定单价计算”不能直接套用。购买时应以当前套餐和账号账单页面为准。 我的建议:上线时就配置费用提醒,观察实际用量。 03|Cloudflare Workers:成本有吸引力,先过兼容性这一关 Cloudflare Workers 的优势很直接:没有 Workers 数据出站流量费,付费计划最低 5 美元/月。 但它仍然会计算请求量和 CPU 用量;数据库、存储、图片服务等也可能单独收费。5 美元是起点,不是整个网站的封顶价。 Next.js 可以通过 OpenNext 适配器部署到 Workers。你可以把适配器理解成“转换工具”,让应用适应平台的运行环境。 它适合愿意做一点配置、关注成本的开发者。 不过,迁移前要检查: 使用的 Next.js 版本和功能是否受支持。 依赖的第三方库能不能运行。 登录、图片、缓存更新是否正常。 能构建成功,只代表第一关通过了。 还有一点:边缘节点离用户近,不代表整个网站一定更快。如果每次请求都要跨洲查询数据库,数据库往返依然可能成为瓶颈。 04|VPS + Docker + Coolify:租金好控制,运维归自己 VPS 就是一台你租来的服务器。 Docker 负责把应用和运行环境打包;Coolify 则提供管理界面,帮助你部署应用、配置域名和证书。 可以理解为:自己搭一个部署平台。 Next.js 支持自建部署,也能使用 standalone 输出,把运行所需文件整理出来,方便放进 Docker。 这条路线适合熟悉 Linux、Docker,或者手里有多个小项目的开发者。 服务器租金比较容易估算,但你还要负责: 系统和依赖更新。 故障排查与监控。 数据备份与恢复。 资源不足时扩容。 别漏算自己的时间。 另外,两个常见误区需要纠正: 前面挂 Cloudflare,不等于服务器流量全部免费。 缓存没命中的请求仍然会回源,服务器供应商的流量规则照样有效。 一台服务器也不会自动变成高可用架构。 它故障时,同机的应用和数据库可能一起停。 05|Railway / Render:想用普通服务器,又不想自己管系统 这类平台介于 Vercel 和自建 VPS 之间。 你提交代码或 Docker 镜像,平台帮你运行应用,省去不少服务器维护工作。 如果项目除了 Next.js,还有后端服务、后台任务,或者需要常驻进程,可以重点看看这条路线。 价格也别只看首页的“起步价”。 例如 Railway 当前 Hobby 最低消费 5 美元/月,Pro 最低消费 20 美元/月,分别包含相应使用额度;超过后按资源用量收费。原稿里的“Pro 5 美元”需要修正。 选这类平台,重点检查:内存、CPU、出站流量、持久化磁盘分别怎么算钱。 Netlify 也值得比较,它提供 Next.js 部署适配;选择前同样要核对功能支持和当前计费规则。 06|AWS + OpenNext / SST:控制力强,也需要更多知识 这套方案会把网站的不同部分交给 AWS 服务: CloudFront 负责内容分发。 S3 存放静态资源和部分缓存。 Lambda 执行服务端逻辑。 其他服务配合处理缓存更新。 OpenNext 负责适配,SST 帮你通过代码创建和管理这些资源。 适合已经在使用 AWS、熟悉云服务,或者有明确基础设施要求的团队。 新手如果只是想上线一个小网站,通常没必要从这里开始。 AWS 可以精细优化成本,但前提是你知道每项资源为什么产生费用。 07|直接照着选 你的情况优先考虑作品集、展示页,能够静态导出静态托管第一个产品,希望尽快上线Vercel关注成本,愿意验证兼容性Cloudflare Workers想托管常驻服务,又不想维护系统Railway / Render熟悉 Docker,有多个小项目VPS + Coolify已有 AWS 经验和基础设施需求AWS + OpenNext / SST 08|真正省钱的,往往是这几件事 ① 能缓存的内容,就别反复计算。 公共文章和产品介绍,可以考虑缓存;个人资料、订单等私有内容,要明确缓存边界。 ② 先把图片处理好。 上传一张几 MB 的原图,再缩成小缩略图展示,会浪费传输和处理资源。 ③ 应用尽量靠近数据库。 选节点时,同时考虑用户位置和数据库位置。 ④ 按真实账单优化。 访问量相同的两个网站,可能一个主要传图片,一个每次都查数据库,成本完全不同。 ⑤ 迁移前,完整跑一遍业务。 重点测试登录、表单、图片、缓存更新,以及聊天等流式响应。 别因为“流量到了 1 TB”或者“账单超过 300 美元”就机械迁移。 先看钱花在哪里,再算节省的费用,能否覆盖迁移和后续维护时间。 对独立开发者来说,好的部署方案,是能让产品稳定上线、费用可以接受、自己也维护得动的那一个。 价格与套餐核对于 2026 年 11 月 8 日,购买前请查看各平台最新规则。
More to read
Feng Yi: Classify the error before retrying; retrying a 4xx error a hundred times still burns quota for nothing
On 2026-11-19, X user @Michael_liyang (Feng Yi) wrote: classify the error before retrying; retrying a 4xx error a hundred times still burns quota for nothing. Steps: 1 retry only 429/5xx/timeouts/network disconnects; 2 for 400/401/403/404, return directly and do not enter backoff; 3 for non-retriable errors, only log to D1 and do not burn the upstream. The error code is the switch for retries. Path: failure → determine the error code → back off only if retriable → return directly if not retriable. The author's conclusion: retrying is a way to save money; misclassifying the error is where burning money begins.
wickedev: a D1 ranking-update loop and about $10,846 across two billing periods.
wickedev reports about $10,846 from a repeated D1 ranking update: a paid $6,209 September bill plus $4,637 estimated for the October billing period. He later says a $5,704 refund was approved and is still being processed.
runes_leo: applying for the Cloudflare for Startups $10k bootstrapped tier with an AI agent
@runes_leo describes applying for the Cloudflare for Startups $10k tier without funding: the three tiers, who qualifies, the four-page form, and three pitfalls (a sign-in button greyed out in Chrome, a required company-domain email, and a payment method required on the linked account). He later corrected the $100k/$350k criteria, said approval and credits were still pending, and on November 10 updated that Workers AI is no longer covered for new members (existing $10k-tier members up to $2,500 until December 1).