Skip to content

Search (query) parameters disable client-side router cache #80042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pomy4 opened this issue Jun 2, 2025 · 0 comments · May be fixed by #80078
Open

Search (query) parameters disable client-side router cache #80042

pomy4 opened this issue Jun 2, 2025 · 0 comments · May be fixed by #80078
Labels
Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. Loading UI and Streaming Related to loading UI (loading.tsx) and streaming.

Comments

@pomy4
Copy link

pomy4 commented Jun 2, 2025

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/pedantic-frog-l2mvhn

To Reproduce

  1. npm run dev or npm run build + npm run start
  2. Click on the "No search param" and "Yes search param" links a few times.
  3. The "No search param" page will show the loading indicator only on the first load (client-side router cache for page segments is configured for 30 seconds), while the "Yes search param" page (which has a search parameter in the url, but otherwise is identical to the "No search param" page) will show the loading indicator every time.

Current vs. Expected behavior

Current: Pages with search parameters are not stored in the client-side router cache - loading indicator is shown every time. Note: back/forward navigation works correctly (no loading indicator).

Expected: Pages with search parameters are stored in the client-side router cache - loading indicator is shown only on the first load.

OR the documentation (https://nextjs.org/docs/app/deep-dive/caching#client-side-router-cache) should be updated to mention that search (query) parameters disable client-side router cache (why?).

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.4.0-canary.61 // Latest available version is detected (15.4.0-canary.61).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Linking and Navigating, Loading UI and Streaming

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

No response

@github-actions github-actions bot added Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. Loading UI and Streaming Related to loading UI (loading.tsx) and streaming. labels Jun 2, 2025
DishankChauhan pushed a commit to DishankChauhan/next.js that referenced this issue Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. Loading UI and Streaming Related to loading UI (loading.tsx) and streaming.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant