Skip to content

Commit f05759f

Browse files
ToriLindsaykodster28
authored andcommitted
[Browser Rendering] Update URL for Workers bindings (cloudflare#23047)
* [Browser Rendering] Update URL for Workers bindings * Update public/__redirects Co-authored-by: Kody Jackson <[email protected]> * Update public/__redirects * Update public/__redirects * Update public/__redirects * Update public/__redirects * Update public/__redirects Co-authored-by: Kody Jackson <[email protected]> --------- Co-authored-by: Kody Jackson <[email protected]>
1 parent 2d192f9 commit f05759f

File tree

11 files changed

+16
-12
lines changed

11 files changed

+16
-12
lines changed

public/__redirects

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,13 @@
246246
/bots/additional-configurations/javascript-detections/ /cloudflare-challenges/challenge-types/javascript-detections/ 301
247247

248248
#browser-rendering
249-
/browser-rendering/get-started/browser-rendering-with-do/ /browser-rendering/workers-binding-api/browser-rendering-with-do/ 301
250-
/browser-rendering/get-started/reuse-sessions/ /browser-rendering/workers-binding-api/reuse-sessions/ 301
251-
/browser-rendering/get-started/screenshots/ /browser-rendering/workers-binding-api/screenshots/ 301
249+
/browser-rendering/get-started/browser-rendering-with-DO/ /browser-rendering/workers-bindings/browser-rendering-with-do/ 301
250+
/browser-rendering/get-started/reuse-sessions/ /browser-rendering/workers-bindings/reuse-sessions/ 301
251+
/browser-rendering/get-started/screenshots/ /browser-rendering/workers-bindings/screenshots/ 301
252+
/browser-rendering/workers-binding-api/ /browser-rendering/workers-bindings/ 301
253+
/browser-rendering/workers-binding-api/screenshots/ /browser-rendering/workers-bindings/screenshots/ 301
254+
/browser-rendering/workers-binding-api/browser-rendering-with-do/ /browser-rendering/workers-bindings/browser-rendering-with-do/ 301
255+
/browser-rendering/workers-binding-api/reuse-sessions/ /browser-rendering/workers-bindings/reuse-sessions/ 301
252256

253257
# byoip
254258
/byoip/about/dynamic-advertisement/ /byoip/concepts/dynamic-advertisement/ 301

src/content/docs/browser-rendering/get-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ sidebar:
77

88
Browser rendering can be used in two ways:
99

10-
- [Workers Bindings](/browser-rendering/workers-binding-api) for complex scripts.
10+
- [Workers Bindings](/browser-rendering/workers-bindings/) for complex scripts.
1111
- [REST API](/browser-rendering/rest-api/) for simple actions.

src/content/docs/browser-rendering/how-to/pdf-generation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
import { Aside, WranglerConfig, PackageManagers } from "~/components";
99

10-
As seen in the [Getting Started guide](/browser-rendering/workers-binding-api/screenshots/), Browser Rendering can be used to generate screenshots for any given URL. Alongside screenshots, you can also generate full PDF documents for a given webpage, and can also provide the webpage markup and style ourselves.
10+
As seen in [this Workers bindings guide](/browser-rendering/workers-bindings/screenshots/), Browser Rendering can be used to generate screenshots for any given URL. Alongside screenshots, you can also generate full PDF documents for a given webpage, and can also provide the webpage markup and style ourselves.
1111

1212
## Prerequisites
1313

src/content/docs/browser-rendering/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Browser Rendering enables developers to programmatically control and interact wi
3232
You can integrate Browser Rendering into your applications using one of the following methods:
3333

3434
- **[REST API](/browser-rendering/rest-api/)**: Ideal for simple, stateless tasks like capturing screenshots, generating PDFs, extracting HTML content, and more.
35-
- **[Workers Bindings](/browser-rendering/workers-binding-api/)**: Suitable for advanced browser automation within [Cloudflare Workers](/workers/). This method provides greater control, enabling more complex workflows and persistent sessions.
35+
- **[Workers Bindings](/browser-rendering/workers-bindings/)**: Suitable for advanced browser automation within [Cloudflare Workers](/workers/). This method provides greater control, enabling more complex workflows and persistent sessions.
3636

37-
Choose the method that best fits your use case. For example, use the [REST API endpoints](/browser-rendering/rest-api/) for straightforward tasks from external applications and use [Workers Bindings](/browser-rendering/workers-binding-api/) for complex automation within the Cloudflare ecosystem.
37+
Choose the method that best fits your use case. For example, use the [REST API endpoints](/browser-rendering/rest-api/) for straightforward tasks from external applications and use [Workers Bindings](/browser-rendering/workers-bindings/) for complex automation within the Cloudflare ecosystem.
3838

3939
## Use Cases
4040

src/content/docs/browser-rendering/platform/playwright.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export default {
189189

190190
### Keep Alive
191191

192-
If users omit the `browser.close()` statement, the browser instance will stay open, ready to be connected to again and [re-used](/browser-rendering/workers-binding-api/reuse-sessions/) but it will, by default, close automatically after 1 minute of inactivity. Users can optionally extend this idle time up to 10 minutes, by using the `keep_alive` option, set in milliseconds:
192+
If users omit the `browser.close()` statement, the browser instance will stay open, ready to be connected to again and [re-used](/browser-rendering/workers-bindings/reuse-sessions/) but it will, by default, close automatically after 1 minute of inactivity. Users can optionally extend this idle time up to 10 minutes, by using the `keep_alive` option, set in milliseconds:
193193

194194
```js
195195
const browser = await playwright.launch(env.MYBROWSER, { keep_alive: 600000 });

src/content/docs/browser-rendering/platform/puppeteer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ This script [launches](https://pptr.dev/api/puppeteer.puppeteernode.launch) the
6666

6767
### Keep Alive
6868

69-
If users omit the `browser.close()` statement, it will stay open, ready to be connected to again and [re-used](/browser-rendering/workers-binding-api/reuse-sessions/) but it will, by default, close automatically after 1 minute of inactivity. Users can optionally extend this idle time up to 10 minutes, by using the `keep_alive` option, set in milliseconds:
69+
If users omit the `browser.close()` statement, it will stay open, ready to be connected to again and [re-used](/browser-rendering/workers-bindings/reuse-sessions/) but it will, by default, close automatically after 1 minute of inactivity. Users can optionally extend this idle time up to 10 minutes, by using the `keep_alive` option, set in milliseconds:
7070

7171
```js
7272
const browser = await puppeteer.launch(env.MYBROWSER, { keep_alive: 600000 });

src/content/docs/browser-rendering/rest-api/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DirectoryListing } from "~/components";
1212

1313
<DirectoryListing />
1414

15-
Use the REST API when you need a fast, simple way to perform common browser tasks such as capturing screenshots, extracting HTML, or generating PDFs without writing complex scripts. If you require more advanced automation, custom workflows, or persistent browser sessions, [Workers Bindings](/browser-rendering/workers-binding-api/) are the better choice.
15+
Use the REST API when you need a fast, simple way to perform common browser tasks such as capturing screenshots, extracting HTML, or generating PDFs without writing complex scripts. If you require more advanced automation, custom workflows, or persistent browser sessions, [Workers Bindings](/browser-rendering/workers-bindings/) are the better choice.
1616

1717
## Before you begin
1818

@@ -22,6 +22,6 @@ Before you begin, make sure you [create a custom API Token](/fundamentals/api/ge
2222

2323
:::note[Note]
2424

25-
Currently, the Cloudflare dashboard displays usage metrics exclusively for the [Workers Bindings method](/browser-rendering/workers-binding-api/). Usage data for the REST API is not yet available in the dashboard. We are actively working on adding REST API usage metrics to the dashboard.
25+
Currently, the Cloudflare dashboard displays usage metrics exclusively for the [Workers Bindings method](/browser-rendering/workers-bindings/). Usage data for the REST API is not yet available in the dashboard. We are actively working on adding REST API usage metrics to the dashboard.
2626

2727
:::
File renamed without changes.

src/content/docs/browser-rendering/workers-binding-api/reuse-sessions.mdx renamed to src/content/docs/browser-rendering/workers-bindings/reuse-sessions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
import { Render, PackageManagers, WranglerConfig } from "~/components";
99

10-
The best way to improve the performance of your browser rendering Worker is to reuse sessions. One way to do that is via [Durable Objects](/browser-rendering/workers-binding-api/browser-rendering-with-do/), which allows you to keep a long running connection from a Worker to a browser. Another way is to keep the browser open after you've finished with it, and connect to that session each time you have a new request.
10+
The best way to improve the performance of your browser rendering Worker is to reuse sessions. One way to do that is via [Durable Objects](/browser-rendering/workers-bindings/browser-rendering-with-do/), which allows you to keep a long running connection from a Worker to a browser. Another way is to keep the browser open after you've finished with it, and connect to that session each time you have a new request.
1111

1212
In short, this entails using `browser.disconnect()` instead of `browser.close()`, and, if there are available sessions, using `puppeteer.connect(env.MY_BROWSER, sessionID)` instead of launching a new browser session.
1313

0 commit comments

Comments
 (0)