Skip to content

Commit 0a0af5f

Browse files
Merge branch 'production' of https://github.com/Marcinthecloud/cloudflare-docs into production
2 parents 5daa0a5 + 099850a commit 0a0af5f

File tree

12 files changed

+637
-336
lines changed

12 files changed

+637
-336
lines changed
727 KB
Loading
1.29 MB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Increased static asset limits for Workers
3+
description: Paid and Workers for Platforms users can now upload up to 100,000 static assets per Worker version, up from the previous limit of 20,000.
4+
products:
5+
- workers
6+
- workers-for-platforms
7+
date: 2025-09-04
8+
---
9+
10+
You can now upload up to **100,000 static assets** per Worker version
11+
12+
- Paid and Workers for Platforms users can now upload up to **100,000 static assets** per Worker version, a 5x increase from the previous limit of 20,000.
13+
- Customers on the free plan still have the same limit as before — 20,000 static assets per version of your Worker
14+
- The individual file size limit of 25 MiB remains unchanged for all customers.
15+
16+
This increase allows you to build larger applications with more static assets without hitting limits.
17+
18+
### Wrangler
19+
20+
To take advantage of the increased limits, you must use **Wrangler version 4.34.0 or higher**.
21+
Earlier versions of Wrangler will continue to enforce the previous 20,000 file limit.
22+
23+
## Learn more
24+
25+
For more information about Workers static assets, see the [Static Assets documentation](/workers/static-assets/) and [Platform Limits](/workers/platform/limits/#static-assets).
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
title: A new, simpler REST API for Cloudflare Workers (Beta)
3+
description: Simpler Workers API, SDK methods, and Terraform resources for directly managing Workers, Versions, and Deployments
4+
date: 2025-09-04
5+
---
6+
You can now manage [**Workers**](/api/resources/workers/subresources/beta/subresources/workers/methods/create/), [**Versions**](/api/resources/workers/subresources/beta/subresources/workers/models/worker/#(schema)), and [**Deployments**](/api/resources/workers/subresources/scripts/subresources/content/methods/update/) as separate resources with a new, resource-oriented API (Beta).
7+
8+
This new API is supported in the [Cloudflare Terraform provider](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs) and the [Cloudflare Typescript SDK](https://github.com/cloudflare/cloudflare-typescript), allowing platform teams to manage a Worker's infrastructure in Terraform, while development teams handle code deployments from a separate repository or workflow. We also designed this API with AI agents in mind, as a clear, predictable structure is essential for them to reliably build, test, and deploy applications.
9+
10+
### Try it out
11+
- [**New beta API endpoints**](/api/resources/workers/subresources/beta/)
12+
- [**Cloudflare TypeScript SDK v5.0.0**](https://github.com/cloudflare/cloudflare-typescript)
13+
- [**Cloudflare Go SDK v6.0.0**](https://github.com/cloudflare/cloudflare-go)
14+
- [**Terraform provider v5.9.0**](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs): [`cloudflare_worker`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/worker) , [`cloudflare_worker_version`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/worker_version), and [`cloudflare_workers_deployments`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_deployment) resources.
15+
- See full examples in our [Infrastructure as Code (IaC) guide](/workers/platform/infrastructure-as-code)
16+
17+
18+
## Before: Eight+ endpoints with mixed responsibilities
19+
![**Before**](~/assets/images/workers/platform/api-before.png)
20+
21+
22+
The existing API was originally designed for simple, one-shot script uploads:
23+
24+
```sh
25+
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/scripts/$SCRIPT_NAME" \
26+
-H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
27+
-H "X-Auth-Key: $CLOUDFLARE_API_KEY" \
28+
-H "Content-Type: multipart/form-data" \
29+
-F 'metadata={
30+
"main_module": "worker.js",
31+
"compatibility_date": "$today$"
32+
}' \
33+
-F "[email protected];type=application/javascript+module"
34+
35+
```
36+
37+
This API worked for creating a basic Worker, uploading all of its code, and deploying it immediately — but came with challenges:
38+
39+
- **A Worker couldn't exist without code**: To create a Worker, you had to upload its code in the same API request. This meant platform teams couldn't provision Workers with the proper settings, and then hand them off to development teams to deploy the actual code.
40+
41+
- **Several endpoints implicitly created deployments**: Simple updates like adding a secret or changing a script's content would implicitly create a new version and immediately deploy it.
42+
43+
- **Updating a setting was confusing**: Configuration was scattered across eight endpoints with overlapping responsibilities. This ambiguity made it difficult for human developers (and even more so for AI agents) to reliably update a Worker via API.
44+
45+
- **Scripts used names as primary identifiers**: This meant simple renames could turn into a risky migration, requiring you to create a brand new Worker and update every reference. If you were using Terraform, this could inadvertently destroy your Worker altogether.
46+
47+
## After: Three resources with clear boundaries
48+
![**After**](~/assets/images/workers/platform/api-after.png)
49+
The new API introduces cleaner resource management with three core resources: [**Worker**](/api/resources/workers/subresources/beta/subresources/workers/methods/create/), [**Versions**](/api/resources/workers/subresources/beta/subresources/workers/models/worker/#(schema)), and [**Deployment**](/api/resources/workers/subresources/scripts/subresources/content/methods/update/).
50+
51+
All endpoints now use simple JSON payloads, with script content embedded as `base64`-encoded strings -- a more consistent and reliable approach than the previous `multipart/form-data` format.
52+
- **Worker**: The parent resource representing your application. It has a stable UUID and holds persistent settings like `name`, `tags`, and `logpush`. You can now create a Worker to establish its identity and settings **before** any code is uploaded.
53+
54+
- **Version**: An immutable snapshot of your code and its specific configuration, like bindings and `compatibility_date`. Creating a new version is a safe action that doesn't affect live traffic.
55+
56+
- **Deployment**: An explicit action that directs traffic to a specific version.
57+
58+
:::note
59+
[Workers](/api/resources/workers/subresources/beta/subresources/workers/) and [Versions](/api/resources/workers/subresources/beta/subresources/workers/subresources/versions/) use the new `/workers/` beta endpoints, while [Deployments](/api/resources/workers/subresources/scripts/subresources/deployments/) remain on the existing `/scripts/` endpoint. Pair the new endpoints with the existing Deployment API for a complete workflow.
60+
:::
61+
62+
## Why this matters
63+
64+
### You can now create Workers before uploading code
65+
66+
Workers are now standalone resources that can be created and configured without any code. Platform teams can provision Workers with the right settings, then hand them off to development teams for implementation.
67+
68+
#### Example: Typescript SDK
69+
```ts
70+
// Step 1: Platform team creates the Worker resource (no code needed)
71+
const worker = await client.workers.beta.workers.create({
72+
name: "payment-service",
73+
account_id: "...",
74+
observability: {
75+
enabled: true,
76+
},
77+
});
78+
79+
// Step 2: Development team adds code and creates a version later
80+
const version = await client.workers.beta.workers.versions.create(worker.id, {
81+
account_id: "...",
82+
main_module: "worker.js",
83+
compatibility_date: "$today",
84+
bindings: [ /*...*/ ],
85+
modules: [
86+
{
87+
name: "worker.js",
88+
content_type: "application/javascript+module",
89+
content_base64: Buffer.from(scriptContent).toString("base64"),
90+
},
91+
],
92+
});
93+
94+
// Step 3: Deploy explicitly when ready
95+
const deployment = await client.workers.scripts.deployments.create(worker.name, {
96+
account_id: "...",
97+
strategy: "percentage",
98+
versions: [
99+
{
100+
percentage: 100,
101+
version_id: version.id,
102+
},
103+
],
104+
});
105+
````
106+
#### Example: Terraform
107+
If you use Terraform, you can now declare the Worker in your Terraform configuration and manage configuration outside of Terraform in your Worker's [`wrangler.jsonc` file](/workers/wrangler/configuration/) and deploy code changes using [Wrangler](/workers/wrangler/).
108+
109+
```tf
110+
resource "cloudflare_worker" "my_worker" {
111+
account_id = "..."
112+
name = "my-important-service"
113+
}
114+
# Manage Versions and Deployments here or outside of Terraform
115+
# resource "cloudflare_worker_version" "my_worker_version" {}
116+
# resource "cloudflare_workers_deployment" "my_worker_deployment" {}
117+
```
118+
119+
### Deployments are always explicit, never implicit
120+
121+
Creating a version and deploying it are now always explicit, separate actions - never implicit side effects. To update version-specific settings (like bindings), you create a new version with those changes. The existing deployed version remains unchanged until you explicitly deploy the new one.
122+
123+
```sh
124+
# Step 1: Create a new version with updated settings (doesn't affect live traffic)
125+
POST /workers/workers/{id}/versions
126+
{
127+
"compatibility_date": "$today",
128+
"bindings": [
129+
{
130+
"name": "MY_NEW_ENV_VAR",
131+
"text": "new_value",
132+
"type": "plain_text"
133+
}
134+
],
135+
"modules": [...]
136+
}
137+
138+
# Step 2: Explicitly deploy when ready (now affects live traffic)
139+
POST /workers/scripts/{script_name}/deployments
140+
{
141+
"strategy": "percentage",
142+
"versions": [
143+
{
144+
"percentage": 100,
145+
"version_id": "new_version_id"
146+
}
147+
]
148+
}
149+
```
150+
151+
### Settings are clearly organized by scope
152+
Configuration is now logically divided: [**Worker settings**](/api/resources/workers/subresources/beta/subresources/workers/) (like `name` and `tags`) persist across all versions, while [**Version settings**](/api/resources/workers/subresources/beta/subresources/workers/subresources/versions/) (like `bindings` and `compatibility_date`) are specific to each code snapshot.
153+
154+
```sh
155+
# Worker settings (the parent resource)
156+
PUT /workers/workers/{id}
157+
{
158+
"name": "payment-service",
159+
"tags": ["production"],
160+
"logpush": true,
161+
}
162+
```
163+
164+
```sh
165+
# Version settings (the "code")
166+
POST /workers/workers/{id}/versions
167+
{
168+
"compatibility_date": "$today",
169+
"bindings": [...],
170+
"modules": [...]
171+
}
172+
```
173+
174+
### `/workers` API endpoints now support UUIDs (in addition to names)
175+
176+
The `/workers/workers/` path now supports addressing a Worker by both its immutable UUID and its mutable name.
177+
178+
```sh
179+
# Both work for the same Worker
180+
GET /workers/workers/29494978e03748669e8effb243cf2515 # UUID (stable for automation)
181+
GET /workers/workers/payment-service # Name (convenient for humans)
182+
```
183+
This dual approach means:
184+
- Developers can use readable names for debugging.
185+
- Automation can rely on stable UUIDs to prevent errors when Workers are renamed.
186+
- Terraform can rename Workers without destroying and recreating them.
187+
188+
189+
## Learn more
190+
- [Infrastructure as Code (IaC) guide](/workers/platform/infrastructure-as-code)
191+
- [API documentation](/api/resources/workers/subresources/beta/)
192+
- [Versions and Deployments overview](/workers/configuration/versions-and-deployments/)
193+
194+
## Technical notes
195+
196+
- The pre-existing Workers REST API remains fully supported. Once the new API exits beta, we'll provide a migration timeline with ample notice and comprehensive migration guides.
197+
- Existing Terraform resources and SDK methods will continue to be fully supported through the current major version.
198+
- While the Deployments API currently remains on the `/scripts/` endpoint, we plan to introduce a new Deployments endpoint under `/workers/` to match the new API structure.

src/content/docs/browser-rendering/faq.mdx

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,53 @@ import { GlossaryTooltip } from "~/components";
1212

1313
Below you will find answers to our most commonly asked questions. If you cannot find the answer you are looking for, refer to the [Discord](https://discord.cloudflare.com) to explore additional resources.
1414

15-
### I see `Cannot read properties of undefined (reading 'fetch')` when using Browser Rendering. How do I fix this?
15+
---
1616

17-
This error occurs because your Puppeteer launch is not receiving the Browser binding or you are not on a Workers Paid plan.
17+
## Getting started & Development
18+
19+
### Does local development support all Browser Rendering features?
20+
21+
Not yet. Local development currently has the following limitation(s):
22+
- Requests larger than 1 MB are not supported.
1823

19-
To resolve: Pass your Browser binding into `puppeteer.launch`.
24+
For full feature access, use `npx wrangler dev --remote`.
2025

2126
### Will Browser Rendering bypass Cloudflare's Bot Protection?
2227

2328
No, Browser Rendering requests are always identified as bots by Cloudflare and do not bypass Bot Protection.
2429

2530
If you are attempting to scan your **own zone** and need Browser Rendering to access areas protected by Cloudflare’s Bot Protection, you can create a [WAF skip rule](/waf/custom-rules/skip/) to bypass the bot protection using a header or a custom user agent.
2631

32+
### Does Browser Rendering rotate IP addresses for outbound requests?
33+
34+
No. Browser Rendering requests originate from Cloudflare's global network and you cannot configure per-request IP rotation. All rendering traffic comes from Cloudflare IP ranges and requests include [automatic headers](/browser-rendering/reference/automatic-request-headers/), such as `cf-biso-request-id` and `cf-biso-devtools` so origin servers can identify them.
35+
36+
### Is there a limit to how many requests a single browser session can handle?
37+
38+
There is no fixed limit on the number of requests per browser session. A single browser can handle multiple requests as long as it stays within available compute and memory limits.
39+
40+
### How can I manage concurrency and session isolation with Browser Rendering?
41+
42+
If you are hitting concurrency [limits](/browser-rendering/platform/limits/#workers-paid), or want to optimize concurrent browser usage with the [Workers Binding method](/browser-rendering/workers-bindings/), here are a few tips:
43+
44+
- Optimize with tabs or shared browsers: Instead of launching a new browser for each task, consider opening multiple tabs or running multiple actions within the same browser instance.
45+
- [Reuse sessions](/browser-rendering/workers-bindings/reuse-sessions/): You can optimize your setup and decrease startup time by reusing sessions instead of launching a new browser every time. If you are concerned about maintaining test isolation (for example, for tests that depend on a clean environment), we recommend using [incognito browser contexts](https://pptr.dev/api/puppeteer.browser.createbrowsercontext), which isolate cookies and cache with other sessions.
46+
47+
If you are still running into concurrency limits you can [request a higher limit](https://forms.gle/CdueDKvb26mTaepa9).
48+
49+
---
50+
51+
## Errors & Troubleshooting
52+
53+
### I see `Cannot read properties of undefined (reading 'fetch')` when using Browser Rendering. How do I fix this?
54+
55+
This error typically occurs because your Puppeteer launch is not receiving the Browser binding. To resolve: Pass your Browser binding into `puppeteer.launch`.
56+
2757
### Why can't I use an XPath selector when using Browser Rendering with Puppeteer?
2858

2959
Currently it is not possible to use Xpath to select elements since this poses a security risk to Workers.
3060

31-
As an alternative try to use a css selector or `page.evaluate` for example:
61+
As an alternative, try to use a css selector or `page.evaluate`. For example:
3262

3363
```ts
3464
const innerHtml = await page.evaluate(() => {
@@ -45,55 +75,16 @@ const innerHtml = await page.evaluate(() => {
4575

4676
:::note
4777

48-
Keep in mind that `page.evaluate` can only return primitive types like strings, numbers, etc.
49-
50-
Returning an `HTMLElement` will not work.
78+
Keep in mind that `page.evaluate` can only return primitive types like strings, numbers, etc. Returning an `HTMLElement` will not work.
5179

5280
:::
5381

54-
### What are the usage limits for Browser Rendering and how do I estimate my costs?
55-
56-
You can view the complete breakdown of concurrency caps, request rates, timeouts, and REST API quotas on the [limits page](/browser-rendering/platform/limits/).
57-
58-
You can monitor your Browser Rendering usage in the [Cloudflare dashboard](https://dash.cloudflare.com). Go to **Compute (Workers)** > **Browser Rendering**. Then, you can use [the pricing page](/browser-rendering/platform/pricing/) to estimate your costs.
59-
60-
### Does Browser Rendering rotate IP addresses for outbound requests?
82+
### Why is my screenshot blurry?
6183

62-
No. Browser Rendering requests originate from Cloudflares global network, but you cannot configure per-request IP rotation. All rendering traffic comes from Cloudflare IP ranges and requests include special headers [(`cf-biso-request-id`, `cf-biso-devtools`)](/browser-rendering/reference/automatic-request-headers/) so origin servers can identify them.
84+
It may be because you increased the height and width of the viewport. To fix this, increase the value of the `deviceScaleFactor` (default is 1).
6385

6486
### I see `Error processing the request: Unable to create new browser: code: 429: message: Browser time limit exceeded for today`. How do I fix it?
6587

6688
This error indicates you have hit the daily browser-instance limit on the Workers Free plan. [Free-plan accounts are capped at free plan limit is 10 minutes of browser use a day](/browser-rendering/platform/limits/#workers-free) once you exceed those, further creation attempts return a 429 until the next UTC day.
6789

6890
To resolve: [Upgrade to a Workers Paid plan](/workers/platform/pricing/) which allows for more than 10 minutes of usage a day and has higher [limits](/browser-rendering/platform/limits/#workers-paid). If you recently upgraded but still see this error, try redeploying your Worker to ensure your usage is correctly associated with your new plan.
69-
70-
### Does local development support all Browser Rendering features?
71-
72-
Not yet. Local development currently has the following limitation(s):
73-
- Requests larger than 1 MB are not supported.
74-
75-
For full feature access, use `npx wrangler dev --remote`.
76-
77-
### I upgraded from the Workers Free plan, but I'm still hitting the 10-minute per day limit. What should I do?
78-
79-
If you recently upgraded to the Workers Paid plan to increase your Browser Rendering usage limits, but you're still encountering the 10-minute per day cap, try redeploying your Worker. This ensures your usage is correctly associated with your new plan.
80-
81-
### Why is my screenshot blurry?
82-
83-
If your screenshot is blurry, it may be because you increased the height and width of the viewport. To fix this, increase the value of the `deviceScaleFactor` (default is 1).
84-
85-
### How can I manage concurrency and session isolation with Browser Rendering?
86-
87-
If you are hitting concurrency limits, or would like to better manage concurrent browser usage with the [Workers Binding method](/browser-rendering/workers-bindings/), here are a few tips:
88-
89-
- Optimize with tabs or shared browsers: Instead of launching a new browser for each task, consider opening multiple tabs or running multiple actions within the same browser instance.
90-
- [Reuse sessions](/browser-rendering/workers-bindings/reuse-sessions/): You can optimize your setup and decrease startup time by reusing sessions instead of launching a new browser every time. If you are concerned about maintaining test isolation, for example for tests that depend on a clean environment, we recommend using [incognito browser contexts](https://pptr.dev/api/puppeteer.browser.createbrowsercontext), which isolate cookies and cache with other sessions.
91-
92-
If you are still running into concurrency limits you can [request a higher limit](https://forms.gle/CdueDKvb26mTaepa9).
93-
94-
### Is there a limit to how many requests a single browser session can handle?
95-
96-
No, there is not a fixed limit on the number of requests per browser session. A single browser can handle multiple requests as long as it stays within the available compute and memory limits.
97-
98-
### Do failed API calls, such as those that time out, add to billable browser hours?
99-
No. If a request to the Browser Rendering REST API fails with a `waitForTimeout` error, the browser session is not charged.

0 commit comments

Comments
 (0)