docs: clarify prerender and isr route rules - #4461
Conversation
Document that prerender and isr are mutually exclusive on the same route. Closes nitrojs#4041.
|
@vittorioexp is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe routing documentation now distinguishes build-time prerendering from on-demand ISR. The ChangesRouting behavior documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/1.docs/5.routing.md`:
- Around line 669-675: Update the ISR note near the Vercel configuration
guidance to include or link to the browser-cache Cache-Control workaround
documented in `#4041`. Keep the existing explanation that ISR and build-time
prerender should not be combined on the same route.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3c5e786b-42c0-448d-9609-7b70a0add7f3
📒 Files selected for processing (2)
docs/1.docs/5.routing.mdsrc/types/route-rules.ts
| ### ISR (Vercel) | ||
|
|
||
| Configure Incremental Static Regeneration for Vercel deployments: | ||
|
|
||
| ::note | ||
| ISR generates pages on demand and revalidates them according to the expiration you set. It is an alternative to build-time `prerender`, not something you combine with it on the same route. | ||
| :: |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n -C3 'Cache-Control|browser cache|heuristic|stale HTML|revalidation' docs/1.docs/5.routing.mdRepository: nitrojs/nitro
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## Target section\n'
sed -n '650,700p' docs/1.docs/5.routing.md
printf '\n## Search for issue 4041 and cache guidance\n'
rg -n -C2 '`#4041`|4041|Cache-Control|browser cache|stale HTML|revalidation|ISR|prerender' docs . -g '!**/node_modules/**' -g '!**/dist/**' -g '!**/build/**'Repository: nitrojs/nitro
Length of output: 50371
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## Target section\n'
sed -n '660,690p' docs/1.docs/5.routing.md
printf '\n## Issue and cache guidance search\n'
rg -n -C3 '`#4041`|4041|Cache-Control|browser cache|stale HTML|revalidation|surrogate-control|no-store|max-age' .Repository: nitrojs/nitro
Length of output: 20152
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for any mention of issue 4041 or cache workarounds in repo docs.
rg -n -C3 '4041|Cache-Control|browser cache|stale HTML|revalidation|surrogate-control|no-store|max-age' docs . -g '!**/node_modules/**' -g '!**/dist/**' -g '!**/build/**'Repository: nitrojs/nitro
Length of output: 24073
Add the browser-cache workaround to the ISR note. This section only covers ISR/prerender incompatibility; include the Cache-Control workaround from #4041 here or link to where it’s documented.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/1.docs/5.routing.md` around lines 669 - 675, Update the ISR note near
the Vercel configuration guidance to include or link to the browser-cache
Cache-Control workaround documented in `#4041`. Keep the existing explanation that
ISR and build-time prerender should not be combined on the same route.
Summary
Closes #4041.
Documents that
prerenderandisrmust not be combined on the same route — prerendered pages are generated at build time and ISR is ignored. Adds routing guide warnings and updates theisrJSDoc.Test plan