You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/local-development.mdx
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ head: []
7
7
description: Develop your Workers locally via Wrangler.
8
8
---
9
9
10
+
import { Aside } from"~/components";
11
+
10
12
Cloudflare Workers and most connected resources can be fully developed and tested locally - providing confidence that the applications you build locally will work the same way in production. This allows you to be more efficient and effective by providing a faster feedback loop and removing the need to [test against remote resources](#develop-using-remote-resources-and-bindings). Local development runs against the same production runtime used by Cloudflare Workers, [workerd](https://github.com/cloudflare/workerd).
11
13
12
14
In addition to testing Workers locally with [`wrangler dev`](/workers/wrangler/commands/#dev), the use of Miniflare allows you to test other Developer Platform products locally, such as [R2](/r2/), [KV](/kv/), [D1](/d1/), and [Durable Objects](/durable-objects/).
@@ -127,6 +129,19 @@ npx wrangler dev --remote
127
129
128
130
For some products like KV and R2, remote resources used for `wrangler dev --remote` must be specified with preview ID/names in the [Wrangler configuration file](/workers/wrangler/configuration/) such as `preview_id` for KV or `preview_bucket name` for R2. Resources used for remote mode (preview) can be different from resources used for production to prevent changing production data during development. To use production data in `wrangler dev --remote`, set the preview ID/name of the resource to the ID/name of your production resource.
129
131
132
+
<Aside
133
+
type="note"
134
+
title="Number of routes per zone in a remote development session"
135
+
>
136
+
When you run a remote development session using the `--remote` flag, a
137
+
[limit](/workers/platform/limits/#routes-and-domains) of 50
138
+
[routes](/workers/configuration/routing/routes/) per zone is enforced. The
139
+
Quick Editor in the Cloudflare Dashboard also uses `wrangler dev --remote`, so
140
+
any changes made there are subject to the same 50-route limit. If your zone
141
+
has more than 50 routes, you **will not be able to run a remote session**. To
142
+
fix this, you must remove routes until you are under the 50-route limit.
143
+
</Aside>
144
+
130
145
## Customize `wrangler dev`
131
146
132
147
You can customize how `wrangler dev` works to fit your needs. Refer to [the `wrangler dev` documentation](/workers/wrangler/commands/#dev) for available configuration options.
|[Request](#request)| 100,000 requests/day<br/>1000 requests/min | No limit |
64
+
|[Worker memory](#memory)| 128 MB | 128 MB |
65
+
|[CPU time](#cpu-time)| 10 ms | 5 min HTTP request <br/> 15 min [Cron Trigger](/workers/configuration/cron-triggers/)|
66
66
|[Duration](#duration)| No limit | No limit for Workers. <br/>15 min duration limit for [Cron Triggers](/workers/configuration/cron-triggers/), [Durable Object Alarms](/durable-objects/api/alarms/) and [Queue Consumers](/queues/configuration/javascript-apis/#consumer)|
67
67
68
68
### Duration
@@ -93,7 +93,7 @@ Scheduled Workers ([Cron Triggers](/workers/configuration/cron-triggers/)) have
@@ -290,6 +290,10 @@ If you need more than 500 Workers, consider using [Workers for Platforms](/cloud
290
290
291
291
Each zone has a limit of 1,000 [routes](/workers/configuration/routing/routes/). If you require more than 1,000 routes on your zone, consider using [Workers for Platforms](/cloudflare-for-platforms/workers-for-platforms/) or request an increase to this limit.
292
292
293
+
### Number of routes per zone when using `wrangler dev --remote`
294
+
295
+
When you run a [remote development](/workers/local-development/#develop-using-remote-resources-and-bindings) session using the `--remote` flag, a limit of 50 [routes](/workers/configuration/routing/routes/) per zone is enforced. The Quick Editor in the Cloudflare Dashboard also uses `wrangler dev --remote`, so any changes made there are subject to the same 50-route limit. If your zone has more than 50 routes, you **will not be able to run a remote session**. To fix this, you must remove routes until you are under the 50-route limit.
296
+
293
297
### Number of custom domains per zone
294
298
295
299
Each zone has a limit of 100 [custom domains](/workers/configuration/routing/custom-domains/). If you require more than 100 custom domains on your zone, consider using a wildcard [route](/workers/configuration/routing/routes/) or request an increase to this limit.
@@ -323,10 +327,11 @@ Unbound and Bundled plans have been deprecated and are no longer available for n
323
327
If your Worker is on an Unbound plan, your limits are exactly the same as the Workers Paid plan.
324
328
325
329
If your Worker is on a Bundled plan, your limits are the same as the Workers Paid plan except for the following differences:
326
-
* Your limit for [subrequests](/workers/platform/limits/#subrequests) is 50/request
327
-
* Your limit for [CPU time](/workers/platform/limits/#cpu-time) is 50ms for HTTP requests and 50ms for [Cron Triggers](/workers/configuration/cron-triggers/)
328
-
* You have no [Duration](/workers/platform/limits/#duration) limits for [Cron Triggers](/workers/configuration/cron-triggers/), [Durable Object alarms](/durable-objects/api/alarms/), or [Queue consumers](/queues/configuration/javascript-apis/#consumer)
329
-
* Your Cache API limits for calls/requests is 50
330
+
331
+
- Your limit for [subrequests](/workers/platform/limits/#subrequests) is 50/request
332
+
- Your limit for [CPU time](/workers/platform/limits/#cpu-time) is 50ms for HTTP requests and 50ms for [Cron Triggers](/workers/configuration/cron-triggers/)
333
+
- You have no [Duration](/workers/platform/limits/#duration) limits for [Cron Triggers](/workers/configuration/cron-triggers/), [Durable Object alarms](/durable-objects/api/alarms/), or [Queue consumers](/queues/configuration/javascript-apis/#consumer)
334
+
- Your Cache API limits for calls/requests is 50
330
335
331
336
---
332
337
@@ -336,4 +341,4 @@ Review other developer platform resource limits.
0 commit comments