Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/router/guide/preloading.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Preloading in TanStack Router is a way to load a route before the user actually

Preloaded route matches are temporarily cached in memory with a few important caveats:

- **Unused preloaded data is removed after 30 seconds by default.** This can be configured by setting the `defaultPreloadMaxAge` option on your router.
- **Unused preloaded data is removed after 30 seconds by default.** This can be configured by setting the `defaultPreloadGcTime` option on your router.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Default duration appears incorrect (30s vs 30m)

Line 23 says preloaded data is removed after 30 seconds by default, but defaultPreloadGcTime is documented in router core as 1_800_000 (30 minutes). Please update this value to avoid misleading users.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/router/guide/preloading.md` at line 23, The doc text incorrectly states
"30 seconds" for preloaded data GC; update the sentence to "30 minutes" to match
the router core defaultPreloadGcTime value (1_800_000), ensuring the docs and
the defaultPreloadGcTime constant/setting are consistent and the explanatory
sentence mentions "30 minutes (defaultPreloadGcTime = 1_800_000)" or equivalent
phrasing.

- **Obviously, when a route is loaded, its preloaded version is promoted to the router's normal pending matches state.**

If you need more control over preloading, caching and/or garbage collection of preloaded data, you should use an external caching library like [TanStack Query](https://tanstack.com/query).
Expand Down
Loading