Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions content/(dynamic)/functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ There is nothing to switch on. Every worker gets its database and outbound `fetc

Anything else from an unclaimed space answers 403 with "This host isn't reachable from an unclaimed space. Claim the space to reach any public host." Claiming opens it up without a republish.

Outbound requests from a worker leave from Cloudflare's shared network addresses, not from a dedicated or fixed IP for your space. Other spaces can send from the same addresses, so an API that rate-limits or blocks by IP can count their traffic against yours and answer `429` on your first request. There is also no fixed address to put on an API allowlist. Plan for it:

- Send the key the API issues you. An API that limits per key then counts only your requests.
- Retry a `429` with backoff. When `Retry-After` is longer than the request can wait, return an error and try again on a later request or [cron run](/crons).
- Cache responses in `env.DB` so repeat requests are answered from the cache.
- Call the API from the browser instead when it accepts cross-origin requests and the call needs no secret.

## What is on `env`

`env` carries the space's environment variables. See [Environment variables](/environment-variables) for how to set them.
Expand Down
Loading