Skip to content

Commit f78de3e

Browse files
niklasbecniklasbecfranky47
authored
doc: Add limits page to docs (#739)
* feat: add limits tab to docs * fix: rephrasing * fix: change some wordings as requested by franky47 * fix: add a sentence for url lengths * fix: add a missing dot * doc: Add og:image for limits page --------- Co-authored-by: niklasbec <niklabeckerr@gmail.com> Co-authored-by: Francois Best <github@francoisbest.com>
1 parent 4715d87 commit f78de3e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

packages/docs/content/docs/limits.mdx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Limits
3+
description: There are some limits you should be aware of when using nuqs or URL params in general.
4+
---
5+
6+
## URL update throttling
7+
8+
Browsers rate-limit the History API, updates to the URL are queued and throttled to a default of 50ms, which seems to satisfy most browsers even when sending high-frequency query updates, like binding to a text input or a slider.
9+
10+
Safari’s rate limits are much higher and require a throttle of 120ms (320ms for older versions of Safari).
11+
12+
Nuqs handles this out of the box so you don't run into those rate-limits, however it is possible to set your own custom throttles.
13+
14+
For more info how to set custom throttles see [Throttling URL updates](./options#throttling-url-updates).
15+
16+
## Max URL lengths
17+
18+
Most modern browsers enforce a max URL length, which can vary:
19+
20+
- **Chrome:** ~2 MB (practically, you might encounter issues at around 2,000 characters).
21+
- **Firefox:** ~65,000 characters.
22+
- **Safari:** Generally has more restrictive limits (around 80,000 characters).
23+
- **IE/Edge:** Historically limited to 2,083 characters (IE), although Edge has relaxed this limit.
24+
25+
Additionally, transport mechanisms like social media, messaging apps, and emails may impose significantly lower limits on URL length. Long URLs may be truncated, wrapped, or rendered unusable when shared on these platforms.
26+
27+
Keep in mind that not all application state should be stored in URLs. Exceeding the 2,000-character range may indicate the need to reconsider your state management approach.

packages/docs/content/docs/meta.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"options",
1212
"batching",
1313
"server-side",
14+
"limits",
1415
"---Going further---",
1516
"utilities",
1617
"debugging",

packages/docs/public/og/limits.jpg

448 KB
Loading

0 commit comments

Comments
 (0)