Skip to content

Commit b6868eb

Browse files
authored
Reference guide when to use Snippets vs Workers (#20836)
1 parent 171373c commit b6868eb

File tree

2 files changed

+579
-2
lines changed

2 files changed

+579
-2
lines changed

src/content/docs/rules/snippets/index.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ head:
1111
content: Cloudflare Snippets (beta)
1212
---
1313

14-
import { FeatureTable, GlossaryTooltip, Render } from "~/components";
14+
import { FeatureTable, GlossaryTooltip, Render, Card } from "~/components";
1515

1616
Cloudflare Snippets (beta) provide a powerful and flexible way to customize the behavior of your website or application using short pieces of JavaScript code. With Snippets, you can modify HTTP response headers, implement <GlossaryTooltip term="JSON web token (JWT)" prepend="JSON web token (JWT) is ">JWT</GlossaryTooltip> validation, perform complex <GlossaryTooltip term="redirect">redirects</GlossaryTooltip>, and much more.
1717

@@ -49,14 +49,20 @@ Each <GlossaryTooltip term="Snippets subrequest" prepend="A subrequest is ">subr
4949

5050
## Limits
5151

52-
Cloudflare Snippets are lightweight compared to [Cloudflare Workers](/workers/). The following limits apply:
52+
Cloudflare Snippets are designed for fast, lightweight edge logic. The following limits apply:
5353

5454
| Description | All plans |
5555
| -------------------------- | --------- |
5656
| Maximum execution time | 5 ms |
5757
| Maximum memory | 2 MB |
5858
| Maximum total package size | 32 KB |
5959

60+
<Card title="Need guidance on choosing between Snippets and Workers?" icon="magnifier">
61+
62+
Explore our [detailed guide](/rules/snippets/when-to-use/) for best practices, real-world use cases, and example implementations.
63+
64+
</Card>
65+
6066
## Execution order
6167

6268
<Render file="product-execution-order" />

0 commit comments

Comments
 (0)