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
-[Observability](/workers/observability/logs/workers-logs/), [Logpush](/workers/observability/logs/logpush/), and [Tail Worker](/workers/observability/logs/tail-workers/) settings
27
+
- Runtime [limits](/workers/platform/limits/)
28
28
29
29
Preview settings are distinct from your Production settings. Previews never inherit from production.
30
30
31
31
When you create a new Preview — via `wrangler preview`, CI, the dashboard, or a pull request — it starts with your Worker's Preview settings. Individual deployments can override those values for one deployment without changing the shared settings. See [Per-deployment overrides](/workers/previews/configuring-previews/#per-deployment-overrides).
32
32
33
33
## Preview URLs
34
34
35
-
Every Preview has an auto-generated URL on the `workers.dev` subdomain:
35
+
Every Preview has two kinds of URLs on the `workers.dev` subdomain.
36
+
37
+
The **Preview URL** is the stable URL for a Preview. Think of it as your branch URL — it always points at the latest deployment.
The **Deployment URL** is the URL for a specific deployment. Think of it as your commit URL — it is immutable and, once created, always points at that exact deployment.
40
42
41
-
The Preview URL always points to the latest deployment — you can think of it as your Preview domain. A deployment URL always points to that one specific deployment and never changes, even after you push a new deployment to the Preview.
You can also serve Previews from your own **custom domain**. When Previews are enabled on a Worker custom domain, Cloudflare provisions a wildcard DNS record (`*.app.example.com`) and a wildcard certificate to cover all Preview subdomains:
Previews can only be reached through these auto-generated URLs and custom domain wildcard URLs.
49
-
50
-
User-managed triggers like Worker routes, cron triggers, and Queue consumers do not apply to Previews.
50
+
Previews can only be reached through these auto-generated URLs and custom domain wildcard URLs. User-managed triggers like [Worker routes](/workers/configuration/routing/routes/), [cron triggers](/workers/configuration/cron-triggers/), and [Queue](/queues/) consumers do not apply to Previews.
51
51
52
52
For configuration details, see [Use a custom domain for Previews](/workers/previews/#use-a-custom-domain-for-previews).
53
53
@@ -61,10 +61,11 @@ Previews are designed so that testing changes does not risk your production data
61
61
62
62
When your Worker defines the class itself, these binding types give each Preview its own isolated namespace, instances, and storage — separate from production and from every other Preview:
63
63
64
-
-**Durable Objects**
65
-
-**Workflows**
66
-
-**Containers** (hosted on Durable Objects)
67
-
Concretely, this means:
64
+
-[**Durable Objects**](/durable-objects/)
65
+
-[**Workflows**](/workflows/)
66
+
-[**Containers**](/containers/) (hosted on Durable Objects)
67
+
68
+
Concretely, this means:
68
69
- A Durable Object you reach via `env.MY_DO.getByName("some-id")` in a Preview returns a different instance — with different storage — than the same call in production, and different from the same call in another Preview.
69
70
- Writes to `ctx.storage` inside a Preview's Durable Object never affect production data or other Previews.
70
71
- State persists across deployments within the same Preview. Pushing a new deployment to the Preview keeps its Durable Object storage intact.
@@ -78,23 +79,23 @@ For Durable Objects and Workflows defined in the same Worker, you can access the
78
79
79
80
These binding types reference resources that exist at the account level. All Previews pointing at the same resource ID share it with each other and with production (unless you override the ID in `previews`):
80
81
81
-
-KV
82
-
-D1
83
-
-R2
84
-
- Queues (producers only — Previews cannot consume from Queues)
85
-
- Vectorize
86
-
- Hyperdrive
87
-
- Analytics Engine
88
-
- Pipelines
89
-
- Secrets Store
90
-
- mTLS certificates
91
-
- Dispatch namespaces
82
+
-[KV](/kv/)
83
+
-[D1](/d1/)
84
+
-[R2](/r2/)
85
+
-[Queues](/queues/) (producers only — Previews cannot consume from Queues)
To keep Preview writes separate from production, create a dedicated resource for Previews and reference it under `previews`, or use [auto-provisioning](/workers/previews/configuring-previews/#auto-provisioning) for KV, D1, and R2.
94
95
95
96
### Always target production
96
97
97
-
-**Service bindings** from a Preview always resolve to the bound Worker's production deployment. You cannot point a service binding at another Preview.
98
+
-[**Service bindings**](/workers/runtime-apis/bindings/service-bindings/) from a Preview always resolve to the bound Worker's production deployment. You cannot point a service binding at another Preview.
Copy file name to clipboardExpand all lines: src/content/docs/workers/previews/configuring-previews.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,11 +235,11 @@ This reference example shows all supported binding types in `previews`.
235
235
236
236
Previews do **not** inherit bindings from your top-level Wrangler configuration. Any binding you want available inside a Preview must be declared in the `previews` block. If you omit a binding here, your Preview will not have access to it at runtime.
237
237
238
-
For most binding types — such as KV, D1, R2, Queues, Vectorize, and Hyperdrive — all of your Previews share the same underlying resource that you specify in `previews`. These are account-level resources referenced by ID or name, so pointing two Previews at the same `kv_namespaces.id` means they read and write the same data.
238
+
For most binding types — such as [KV](/kv/), [D1](/d1/), [R2](/r2/), [Queues](/queues/), [Vectorize](/vectorize/), and [Hyperdrive](/hyperdrive/) — all of your Previews share the same underlying resource that you specify in `previews`. These are account-level resources referenced by ID or name, so pointing two Previews at the same `kv_namespaces.id` means they read and write the same data.
239
239
240
240
If you need a Preview's writes to stay separate from production, create a dedicated resource for Previews, or use [auto-provisioning](#auto-provisioning) for KV, D1, and R2.
241
241
242
-
The exceptions are **Durable Objects**, **Workflows**, and **Containers**. When your Worker defines the class itself (no `script_name` on the binding), each Preview automatically gets its own isolated namespace and instances, separate from production and from other Previews. State persists across deployments within the same Preview and is deleted when the Preview is deleted. If you set `script_name` to point at another Worker, the binding targets that Worker's production instance and this isolation does not apply — prefer [`ctx.exports`](/workers/runtime-apis/context/#exports) for Durable Objects and Workflows defined in the same Worker.
242
+
The exceptions are [**Durable Objects**](/durable-objects/), [**Workflows**](/workflows/), and [**Containers**](/containers/). When your Worker defines the class itself (no `script_name` on the binding), each Preview automatically gets its own isolated namespace and instances, separate from production and from other Previews. State persists across deployments within the same Preview and is deleted when the Preview is deleted. If you set `script_name` to point at another Worker, the binding targets that Worker's production instance and this isolation does not apply — prefer [`ctx.exports`](/workers/runtime-apis/context/#exports) for Durable Objects and Workflows defined in the same Worker.
243
243
244
244
[Service bindings](/workers/runtime-apis/bindings/service-bindings/) behave differently from both: they always resolve to the bound Worker's production deployment, and cannot be pointed at another Worker's Preview.
245
245
|`previews` field | How it behaves |
@@ -314,12 +314,12 @@ Some `previews` fields are not runtime bindings, but they still change how new P
314
314
|`define`| Changes compile-time replacements for the Preview build. It does not create a runtime binding. |
315
315
Some Preview-related settings come from the top level of your Wrangler config, not from `previews`:
Copy file name to clipboardExpand all lines: src/content/docs/workers/previews/index.mdx
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,10 @@ You create or update a Preview by:
18
18
19
19
Each Preview has two kinds of **URLs**:
20
20
21
-
- A stable **Preview URL** that always points at the latest deployment.
22
-
- A **Deployment URL** for each individual deployment, which is immutable and never changes.
23
-
When you connect your Git repository, Cloudflare posts these URLs on your pull requests as a comment. By default, Previews are served from your `workers.dev` subdomain. You can also route them through a [custom domain](/workers/previews/#use-a-custom-domain-for-previews).
21
+
- A **Preview URL** that points at the latest deployment. Think of it as your branch URL — it always serves whatever you pushed most recently.
22
+
- A **Deployment URL** for each individual deployment. Think of it as your commit URL — it is immutable and never changes.
23
+
24
+
When you connect your Git repository, Cloudflare posts these URLs on your pull requests as a comment. By default, Previews are served from your `workers.dev` subdomain. You can also route them through a [custom domain](/workers/previews/#use-a-custom-domain-for-previews).
0 commit comments