Skip to content

Commit

Permalink
ensure cache key is cased consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Oct 1, 2023
1 parent e8e5f8a commit b357dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ export function createRouterCacheKey(
segment: Segment,
withoutSearchParameters: boolean = false
) {
return Array.isArray(segment)
const cacheKey = Array.isArray(segment)
? `${segment[0]}|${segment[1]}|${segment[2]}`
: withoutSearchParameters && segment.startsWith('__PAGE__')
? '__PAGE__'
: segment

return cacheKey?.toLowerCase()
}
11 changes: 1 addition & 10 deletions packages/next/src/export/routes/app-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export async function generatePrefetchRsc(
path: string,
res: MockedResponse,
pathname: string,
query: NextParsedUrlQuery,
htmlFilepath: string,
renderOpts: RenderOpts
) {
Expand All @@ -41,13 +40,7 @@ export async function generatePrefetchRsc(
renderOpts.isPrefetch = true
delete renderOpts.isRevalidate

const prefetchRenderResult = await render(
req,
res,
pathname,
query,
renderOpts
)
const prefetchRenderResult = await render(req, res, pathname, {}, renderOpts)

prefetchRenderResult.pipe(res)
await res.hasStreamed
Expand Down Expand Up @@ -87,7 +80,6 @@ export async function exportAppPage(
path,
res,
pathname,
query,
htmlFilepath,
renderOpts
)
Expand All @@ -113,7 +105,6 @@ export async function exportAppPage(
path,
res,
pathname,
query,
htmlFilepath,
renderOpts
)
Expand Down

0 comments on commit b357dea

Please sign in to comment.