Skip to content

Commit 88d4f2d

Browse files
PCX-19650: add preconnect to Turnstile docs (#26245)
* PCX-19650: add preconnect to Turnstile docs * Apply suggestions from code review --------- Co-authored-by: Patricia Santa Ana <103445940+patriciasantaana@users.noreply.github.com>
1 parent 660d711 commit 88d4f2d

File tree

1 file changed

+9
-1
lines changed
  • src/content/docs/turnstile/get-started/client-side-rendering

1 file changed

+9
-1
lines changed

src/content/docs/turnstile/get-started/client-side-rendering/index.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ Add the Turnstile JavaScript API to your HTML.
5757
The `api.js` file must be fetched from the exact URL shown above. Proxying or caching this file will cause Turnstile to fail when future updates are released.
5858
:::
5959

60-
#### 2. Add widget elements
60+
#### 2. (Optional) Optimize performance with resource hints
61+
62+
Add resource hints to improve loading performance by establishing early connections to Cloudflare servers. Place this `<link>` tag in your HTML `<head>` section before the Turnstile script.
63+
64+
```html wrap
65+
<link rel="preconnect" href="https://challenges.cloudflare.com">
66+
```
67+
68+
#### 3. Add widget elements
6169

6270
Add widget containers where you want the challenges to appear on your website.
6371

0 commit comments

Comments
 (0)