Skip to content

Commit 5e2768f

Browse files
authored
clarify keepalive
1 parent b1e0fc5 commit 5e2768f

File tree

1 file changed

+2
-2
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+2
-2
lines changed

src/connections/sources/catalog/libraries/website/javascript/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ analytics.load("<YOUR_WRITE_KEY>", {
603603

604604
## Keepalive
605605

606-
You can utilize this in instances where an API call fires on a hard redirect, and are missed from getting captured in Segment. If you set this flag to true, it enables firing the event before the redirect.
606+
You can use the `keepalive` option to make sure that Segment captures API calls triggered during a hard redirect. When enabled, `keepalive` will try to fire events before the redirect occurs.
607607

608-
By default, this is set to `false`. This is because there is a 64kb limit for all fetch requests with keepalive. So when sending keepalive requests, you are competing with other in-flight keepalive requests, regardless of being Segment related requests or not -- which can result in data loss in some scenarios. By default, we only use keep-alive if 1. the page is 'unloading' and 2. the user is using batching.
608+
By default, `keepalive` is set to false, because all fetch requests with the `keepalive` flag are subject to a 64kb size limit. Additionally, keepalive requests share this size limit with all other in-flight `keepalive` requests, regardless of whether they're related to Segment. This competition for resources can lead to data loss in some scenarios.
609609

610610
```ts
611611
analytics.load("<YOUR_WRITE_KEY>",

0 commit comments

Comments
 (0)