Skip to content

Commit 32cc1b3

Browse files
Enable Smart Placement for Workers with Assets (#18395)
* Enable Smart Placement for Workers with Assets * Add note on Smart Placement docs about asset serving * Update src/content/docs/workers/configuration/smart-placement.mdx Co-authored-by: Brendan Irvine-Broque <[email protected]> --------- Co-authored-by: Brendan Irvine-Broque <[email protected]>
1 parent 2497043 commit 32cc1b3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/content/docs/workers/configuration/smart-placement.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Smart Placement only considers candidate locations where the Worker has previous
3131

3232
Smart Placement only affects the execution of [fetch event handlers](/workers/runtime-apis/handlers/fetch/). Workers without a fetch event handler will be ignored by Smart Placement. For Workers with both fetch and non-fetch event handlers, Smart Placement will only affect the execution of the fetch event handler.
3333

34+
Similarly, Smart Placement will not affect where [static assets](/workers/static-assets/) are served from. Static assets will continue to be served from the location nearest to the incoming request. If a Worker is invoked and your code retrieves assets via the [static assets binding](https://developers.cloudflare.com/workers/static-assets/binding/), then assets will be served from the location that your Worker runs in.
35+
3436
## Enable Smart Placement
3537

3638
Smart Placement is available to users on all Workers plans.

src/content/docs/workers/static-assets/compatibility-matrix.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ We plan to bridge the gaps between Workers and Pages and provide ways to migrate
4242
| [Custom HTTP headers for static assets](/pages/configuration/headers/) | 🟡 [^2] ||
4343
| [Middleware](/pages/functions/middleware/) | 🟡 [^3] ||
4444
| [Redirects](/pages/configuration/redirects/) | 🟡 [^4] ||
45-
| [Smart Placement](/workers/configuration/smart-placement/) | [^5] ||
45+
| [Smart Placement](/workers/configuration/smart-placement/) | ||
4646
| **Observability** | | |
4747
| [Workers Logs](/workers/observability/) |||
4848
| [Logpush](/workers/observability/logs/logpush/) |||
4949
| [Tail Workers](/workers/observability/logs/tail-workers/) |||
5050
| [Real-time logs](/workers/observability/logs/real-time-logs/) |||
5151
| **Runtime APIs & Compute Models** | | |
5252
| [Node.js Compatibility Mode](/workers/runtime-apis/nodejs/) |||
53-
| [Durable Objects](/durable-objects/api/) || 🟡 [^6] |
53+
| [Durable Objects](/durable-objects/api/) || 🟡 [^5] |
5454
| [Cron Triggers](/workers/configuration/cron-triggers/) |||
5555
| **Bindings** | | |
5656
| [AI](/workers-ai/get-started/workers-wrangler/#2-connect-your-worker-to-workers-ai) |||
@@ -78,8 +78,8 @@ We plan to bridge the gaps between Workers and Pages and provide ways to migrate
7878
| [Branch Deploy Controls](/pages/configuration/branch-build-controls/) |||
7979
| [Custom Branch Aliases](/pages/how-to/custom-branch-aliases/) |||
8080
| **Pages Functions** | | |
81-
| [File-based Routing](/pages/functions/routing/) |[^7] ||
82-
| [Pages Plugins](/pages/functions/plugins/) |[^8] ||
81+
| [File-based Routing](/pages/functions/routing/) |[^6] ||
82+
| [Pages Plugins](/pages/functions/plugins/) |[^7] ||
8383

8484
[^1]: Does not currently support Workers with static assets. For more details on which bindings are supported in remote development, [refer to the docs](/workers/testing/local-development/#supported-resource-bindings-in-different-environments).
8585

@@ -89,10 +89,8 @@ We plan to bridge the gaps between Workers and Pages and provide ways to migrate
8989

9090
[^4]: You can handle redirects by adding code to your Worker (a [community package](https://npmjs.com/package/redirects-in-workers) is available for `_redirects` support), or you can use [Bulk Redirects](/rules/url-forwarding/bulk-redirects/).
9191

92-
[^5]: You cannot yet enable [Smart Placement](/workers/configuration/smart-placement/) for Workers with static assets. This is a temporary limitation we are working to remove.
92+
[^5]: To [use Durable Objects with your Cloudflare Pages project](/pages/functions/bindings/#durable-objects), you must create a separate Worker with a Durable Object and then declare a binding to it in both your Production and Preview environments. Using Durable Objects with Workers is simpler and recommended.
9393

94-
[^6]: To [use Durable Objects with your Cloudflare Pages project](/pages/functions/bindings/#durable-objects), you must create a separate Worker with a Durable Object and then declare a binding to it in both your Production and Preview environments. Using Durable Objects with Workers is simpler and recommended.
94+
[^6]: Workers [supports popular frameworks](/workers/frameworks/), many of which implement file-based routing.
9595

96-
[^7]: Workers [supports popular frameworks](/workers/frameworks/), many of which implement file-based routing.
97-
98-
[^8]: Everything that is possible with Pages Functions can also be achieved by adding code to your Worker or by using framework-specific plugins for relevant third party tools.
96+
[^7]: Everything that is possible with Pages Functions can also be achieved by adding code to your Worker or by using framework-specific plugins for relevant third party tools.

0 commit comments

Comments
 (0)