Vercel Blob consistent reads:把最新性、并发与缓存分开设计
private get() 与 presignUrl() 可用 useCache: false 绕过 CDN。覆盖同一 pathname 后,默认读取最多可能在 60 秒内返回旧版本。
变化内容
private get() 与 presignUrl() 可用 useCache: false 绕过 CDN。覆盖同一 pathname 后,默认读取最多可能在 60 秒内返回旧版本。
最新性不等于并发控制
该选项只解决 read-after-write。多个 writer 需要 ETag 与 ifMatch,让冲突变成 BlobPreconditionFailedError,而不是静默丢失更新。
鉴权与交付缓存
应在靠近 get() 的 route handler 中鉴权。Vercel 建议浏览器使用 private, no-cache,高度敏感数据使用 no-store。
运维模型
把对象分为 immutable asset、mutable state 与 derived snapshot。仅对 agent memory、checkpoint 和写后验证使用 origin read。
风险
绕过 CDN 会增加延迟与 Fast Origin Transfer。需要事务或大量 writer 时,Postgres 往往更简单。
实践清单
✓盘点 allowOverwrite
✓确认 @vercel/blob ≥ 2.6.1
✓测试 ETag 冲突
✓监控 origin read