Skip to content

Commit 3bb6243

Browse files
kathaylToriLindsay
andauthored
Create timeouts.mdx (#25772)
* Create timeouts.mdx new REST API timeouts page * Fixed table * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Update src/content/docs/browser-rendering/reference/timeouts.mdx Co-authored-by: ToriLindsay <[email protected]> * Fixing table cell format * Update timeouts.mdx test new format w/ bullets * Update timeouts.mdx add sofia edits * Update browser-rendering.yaml update changelog so people know about new guidance pages * Update browser-rendering.yaml fix link * Update browser-rendering.yaml remove changelog --------- Co-authored-by: ToriLindsay <[email protected]>
1 parent 9f5a63d commit 3bb6243

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
pcx_content_type: reference
3+
title: REST API timeouts
4+
sidebar:
5+
order: 5
6+
---
7+
import { Tabs, TabItem } from "~/components";
8+
9+
Browser Rendering uses several independent timers to manage how long different parts of a request can take.
10+
If any of these timers exceed their limit, the request returns a timeout error.
11+
12+
Each timer controls a specific part of the rendering lifecycle — from page load, to selector load, to action.
13+
14+
| Timer | Scope |Default |Max |
15+
| -------------------------------------- | --------------- | --------------- | --------------- |
16+
| `goToOptions.timeout` | Time to wait for the page to load before timeout. | 30 s | 60 s |
17+
| `goToOptions.waitUntil` | Time until page load considered complete: <br />`load` = full page load, including resources, like images and stylesheets. <br />`Event.domcontentloaded` = waits until the DOM content has been fully loaded, fires before the page `load` event. <br />`Event.networkidle0` = there are no active network connections for at least 500 ms. <br />`Event.networkidle2` = there are no more than two active network connections for at least 500 ms. |||
18+
| `waitForSelector` | Time to wait for a specific element (any CSS selector) to appear on the page. | null | 60 s |
19+
| `waitForTimeout` | Additional amount of time to wait after the page has loaded to proceed with actions. | null | 60 s |
20+
| `actionTimeout` | Time to wait for the action itself (for example: a screenshot, PDF, or scrape) to complete after the page has loaded. | null | 5 min |
21+
| `PDFOptions.timeout` | Same as `actionTimeout`, but only applies to the [/pdf endpoint](/browser-rendering/rest-api/pdf-endpoint/). | 30 s | 5 min |
22+
23+
## Notes and recommendations
24+
You can set multiple timers — as long as one is complete, the request will fire.
25+
26+
If you are not getting the expected output:
27+
- Try increasing `goToOptions.timeout` (up to 60 s).
28+
- If waiting for a specific element, use `waitForSelector`. Otherwise, use `goToOptions.waitUntil` set to `networkidle2` to ensure the page has finished loading dynamic content.
29+
- If you are getting a `422`, it may be the action itself (ex: taking a screenshot, extracting the html content) that takes a long time. Try increasing the `actionTimeout` instead.

0 commit comments

Comments
 (0)