Skip to content

Commit fc35aef

Browse files
committed
Only share incremental cache for edge in next start
1 parent c17942f commit fc35aef

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/next/src/server/base-server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,15 +2455,13 @@ export default abstract class Server<
24552455
protocol = parsedFullUrl.protocol as 'https:' | 'http:'
24562456
} catch {}
24572457

2458-
// use existing incrementalCache instance if available
24592458
const incrementalCache: import('./lib/incremental-cache').IncrementalCache =
2460-
(globalThis as any).__incrementalCache ||
2461-
(await this.getIncrementalCache({
2459+
await this.getIncrementalCache({
24622460
requestHeaders: Object.assign({}, req.headers),
24632461
requestProtocol: protocol.substring(0, protocol.length - 1) as
24642462
| 'http'
24652463
| 'https',
2466-
}))
2464+
})
24672465

24682466
// TODO: investigate, this is not safe across multiple concurrent requests
24692467
incrementalCache.resetRequestCache()

packages/next/src/server/web/adapter.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ export async function adapter(
185185
})
186186
}
187187

188-
if (
189-
!(globalThis as any).__incrementalCache &&
190-
(params as any).IncrementalCache
191-
) {
188+
if ((params as any).IncrementalCache) {
192189
;(globalThis as any).__incrementalCache = new (
193190
params as any
194191
).IncrementalCache({

0 commit comments

Comments
 (0)