Unverified Commit 9f9c74b6 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

skip flushToDisk in minimal mode for fetch cache (#58516)

This temporarily disables flushing fetch cache to disk during builds in minimal mode as some additional changes are needed to support it better.

[slack context](https://vercel.slack.com/archives/C042LHPJ1NX/p1699928670252259?thread_ts=1699468188.418499&cid=C042LHPJ1NX)
parent c8bfda43
...@@ -5,15 +5,25 @@ import { IncrementalCache } from '../../server/lib/incremental-cache' ...@@ -5,15 +5,25 @@ import { IncrementalCache } from '../../server/lib/incremental-cache'
import { hasNextSupport } from '../../telemetry/ci-info' import { hasNextSupport } from '../../telemetry/ci-info'
import { nodeFs } from '../../server/lib/node-fs-methods' import { nodeFs } from '../../server/lib/node-fs-methods'
export function createIncrementalCache( export function createIncrementalCache({
incrementalCacheHandlerPath: string | undefined, incrementalCacheHandlerPath,
isrMemoryCacheSize: number | undefined, isrMemoryCacheSize,
fetchCacheKeyPrefix: string | undefined, fetchCacheKeyPrefix,
distDir: string, distDir,
dir: string, dir,
enabledDirectories: NextEnabledDirectories, enabledDirectories,
experimental,
flushToDisk,
}: {
incrementalCacheHandlerPath?: string
isrMemoryCacheSize?: number
fetchCacheKeyPrefix?: string
distDir: string
dir: string
enabledDirectories: NextEnabledDirectories
experimental: { ppr: boolean } experimental: { ppr: boolean }
) { flushToDisk?: boolean
}) {
// Custom cache handler overrides. // Custom cache handler overrides.
let CacheHandler: any let CacheHandler: any
if (incrementalCacheHandlerPath) { if (incrementalCacheHandlerPath) {
...@@ -26,7 +36,7 @@ export function createIncrementalCache( ...@@ -26,7 +36,7 @@ export function createIncrementalCache(
const incrementalCache = new IncrementalCache({ const incrementalCache = new IncrementalCache({
dev: false, dev: false,
requestHeaders: {}, requestHeaders: {},
flushToDisk: true, flushToDisk,
fetchCache: true, fetchCache: true,
maxMemoryCacheSize: isrMemoryCacheSize, maxMemoryCacheSize: isrMemoryCacheSize,
fetchCacheKeyPrefix, fetchCacheKeyPrefix,
......
...@@ -218,7 +218,7 @@ async function exportPageImpl( ...@@ -218,7 +218,7 @@ async function exportPageImpl(
// cache instance for this page. // cache instance for this page.
const incrementalCache = const incrementalCache =
isAppDir && fetchCache isAppDir && fetchCache
? createIncrementalCache( ? createIncrementalCache({
incrementalCacheHandlerPath, incrementalCacheHandlerPath,
isrMemoryCacheSize, isrMemoryCacheSize,
fetchCacheKeyPrefix, fetchCacheKeyPrefix,
...@@ -226,8 +226,11 @@ async function exportPageImpl( ...@@ -226,8 +226,11 @@ async function exportPageImpl(
dir, dir,
enabledDirectories, enabledDirectories,
// PPR is not available for Pages. // PPR is not available for Pages.
{ ppr: false } experimental: { ppr: false },
) // skip writing to disk in minimal mode for now, pending some
// changes to better support it
flushToDisk: !hasNextSupport,
})
: undefined : undefined
// Handle App Routes. // Handle App Routes.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment