Skip to main content

Worker

note
  • 会移除 .html 后缀
  • Cloudflare Workers serverless-next.js#111
  • worker 没有本地临时 存储
    • 使用 KV 或 R2
  • 免费版 3MB 大小限制
  • 付费版 10MB 大小限制

FAQ

OpenAI API Country, region, or territory not supported

  • Cloudflare 会使用请求的 IP 来发出请求
  • 因此从国内发出的请求还是会被拦截

You have not installed wrangler

node $(dirname $(realpath $(which wrangler)))/install-wrangler.js

Cannot perform I/O on behalf of a different request.

  • Hyperdriver 这种需要每个请求都初始化
  • 全局只能缓存类似 dbUrl 这种
Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. (I/O type: Writable)