Files
Hendrik LiebauandGitHub b58b1dc901 Use rewritten pathname for implicit cache tags (#88732)
When a page is accessed via a rewrite, use the destination path (not the source path) when computing implicit tags. This ensures that calling `revalidatePath('/dest')` correctly invalidates cache entries for pages rewritten to that destination.

Fixes `'use cache'` and fetch cache with rewrites. ISR page cache was not affected because it already uses the rewritten pathname as the cache key (via `resolvedUrlPathname` in `base-server.ts`).
2026-01-19 21:50:37 +01:00

22 lines
427 B
TypeScript

import { Suspense } from 'react'
import { connection } from 'next/server'
import SharedPage from '../../shared-page'
async function CachedContent() {
'use cache: remote'
return <SharedPage isDynamic={true} />
}
async function Content() {
await connection()
return <CachedContent />
}
export default function Page() {
return (
<Suspense fallback={<div>Loading...</div>}>
<Content />
</Suspense>
)
}