Skip to content

Fix proxied landing sitemap and rewrites#355

Closed
ben-fornefeld wants to merge 2 commits into
mainfrom
fix-proxied-sitemap-rewrites
Closed

Fix proxied landing sitemap and rewrites#355
ben-fornefeld wants to merge 2 commits into
mainfrom
fix-proxied-sitemap-rewrites

Conversation

@ben-fornefeld

Copy link
Copy Markdown
Member

Summary

  • revalidate the generated sitemap metadata route so landing-page sitemap updates are reflected after ISR
  • remove the sitemap-derived static params allowlist from the proxied rewrite route
  • explicitly allow dynamic params so new landing/blog URLs can be generated on first request and cached by ISR

Verification

  • bunx vitest run tests/unit/sitemap.test.ts tests/integration/proxy.test.ts
  • bunx biome check src/app/sitemap.ts src/app/'(rewrites)'/'[[...slug]]'/route.ts
  • bunx tsc --noEmit --pretty false

Copilot AI review requested due to automatic review settings June 5, 2026 15:58
@ben-fornefeld ben-fornefeld requested a review from drankou as a code owner June 5, 2026 15:58
@cla-bot cla-bot Bot added the cla-signed label Jun 5, 2026
@cursor

cursor Bot commented Jun 5, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes SEO and routing behavior for proxied landing/blog URLs (first-request generation vs build-time allowlist) and how often the public sitemap updates; misconfiguration could affect discoverability or caching of new paths.

Overview
Fixes proxied landing/blog routing and sitemap freshness by changing how the catch-all rewrite route is built and how the unified sitemap is cached.

The rewrite proxy route no longer pre-builds pages from the merged sitemap via generateStaticParams. It sets dynamicParams = true while keeping static generation with a 15-minute revalidate, so paths that match rewrite rules can be rendered on first request and then cached by ISR instead of being limited to URLs known at build time.

The sitemap metadata route now exports revalidate = 900 so the aggregated sitemap (including proxied landing content) refreshes on the same 15-minute cadence instead of staying stale across ISR cycles.

Reviewed by Cursor Bugbot for commit cb5ca46. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 5, 2026 4:03pm
web-juliett Ready Ready Preview, Comment Jun 5, 2026 4:03pm

Request Review

Copilot AI left a comment

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.

Pull request overview

This PR updates Next.js App Router caching/prerender behavior so the generated sitemap and the proxied “rewrites” route reflect new landing/blog URLs via ISR without requiring a build-time allowlist.

Changes:

  • Adds export const revalidate to the sitemap metadata route to ensure it is revalidated on the same interval as its internal fetch caching.
  • Removes the sitemap-derived generateStaticParams() allowlist from the proxied rewrite catch-all route.
  • Enables dynamic params on the proxied rewrite route so new paths can be generated on first request and cached via ISR.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/app/sitemap.ts Exposes a route-level revalidate value so sitemap output is regenerated on the intended interval.
src/app/(rewrites)/[[...slug]]/route.ts Removes build-time static params allowlist and enables dynamic params for ISR-backed first-hit generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/(rewrites)/[[...slug]]/route.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f247a94f69

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/app/sitemap.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants