Unverified Commit ce5206fa authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

[dynamicIO] Fix dev warmup (#77829)

When `dynamicIO` is enabled, we're triggering a warmup request in dev mode. This ensures that replayed logs are associated with the correct environment (`Prerender` vs. `Server`), by seeding the caches before the actual render.

This PR fixes two issues with the dev warmup:
- Ensures that cache keys are identical between the warmup, the subsequent dynamic render, and the dynamic validation, by providing the HMR refresh hash (part of the cache key) for all dev render phases.
- Ensures that stale cache entries are discarded during the warmup, by providing the implicit tags also during the warmup (and the dynamic validation).
parent f1312ef9
......@@ -12,6 +12,7 @@ export const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch' as const
export const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =
'Next-Router-Segment-Prefetch' as const
export const NEXT_HMR_REFRESH_HEADER = 'Next-HMR-Refresh' as const
export const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const
export const NEXT_URL = 'Next-Url' as const
export const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const
......
......@@ -46,6 +46,7 @@ import type { GlobalErrorComponent } from '../../error-boundary'
import type { DevIndicatorServerState } from '../../../../server/dev/dev-indicator-server-state'
import reportHmrLatency from '../utils/report-hmr-latency'
import { TurbopackHmr } from '../utils/turbopack-hot-reloader-common'
import { NEXT_HMR_REFRESH_HASH_COOKIE } from '../../app-router-headers'
export interface Dispatcher {
onBuildOk(): void
......@@ -412,7 +413,7 @@ function processMessage(
// Store the latest hash in a session cookie so that it's sent back to the
// server with any subsequent requests.
document.cookie = `__next_hmr_refresh_hash__=${obj.hash}`
document.cookie = `${NEXT_HMR_REFRESH_HASH_COOKIE}=${obj.hash}`
if (RuntimeErrorHandler.hadRuntimeError) {
if (reloading) return
......
......@@ -53,6 +53,7 @@ import {
NEXT_URL,
RSC_HEADER,
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,
NEXT_HMR_REFRESH_HASH_COOKIE,
} from '../../client/components/app-router-headers'
import {
createTrackedMetadataContext,
......@@ -226,6 +227,12 @@ export type AppRenderContext = {
isNotFoundPath: boolean
nonce: string | undefined
res: BaseNextResponse
/**
* For now, the implicit tags are common for the whole route. If we ever start
* rendering/revalidating segments independently, they need to move to the
* work unit store.
*/
implicitTags: ImplicitTags
}
interface ParseRequestHeadersOptions {
......@@ -679,7 +686,15 @@ async function warmupDevRender(
req: BaseNextRequest,
ctx: AppRenderContext
): Promise<RenderResult> {
const renderOpts = ctx.renderOpts
const {
clientReferenceManifest,
componentMod,
getDynamicParamFromSegment,
implicitTags,
renderOpts,
workStore,
} = ctx
if (!renderOpts.dev) {
throw new InvariantError(
'generateDynamicFlightRenderResult should never be called in `next start` mode.'
......@@ -687,8 +702,8 @@ async function warmupDevRender(
}
const rootParams = getRootParams(
ctx.componentMod.tree,
ctx.getDynamicParamFromSegment
componentMod.tree,
getDynamicParamFromSegment
)
function onFlightDataRenderError(err: DigestedError) {
......@@ -715,7 +730,7 @@ async function warmupDevRender(
type: 'prerender',
phase: 'render',
rootParams,
implicitTags: undefined,
implicitTags,
renderSignal: renderController.signal,
controller: prerenderController,
cacheSignal,
......@@ -725,6 +740,7 @@ async function warmupDevRender(
stale: INFINITE_CACHE,
tags: [],
prerenderResumeDataCache,
hmrRefreshHash: req.cookies[NEXT_HMR_REFRESH_HASH_COOKIE],
}
const rscPayload = await workUnitAsyncStorage.run(
......@@ -737,9 +753,9 @@ async function warmupDevRender(
// which contains the subset React.
workUnitAsyncStorage.run(
prerenderStore,
ctx.componentMod.renderToReadableStream,
componentMod.renderToReadableStream,
rscPayload,
ctx.clientReferenceManifest.clientModules,
clientReferenceManifest.clientModules,
{
onError,
signal: renderController.signal,
......@@ -757,7 +773,7 @@ async function warmupDevRender(
// that calls into renderToHTML... expects a result. We should refactor this to
// lift the warmup pathway outside of renderToHTML... but for now this suffices
return new FlightRenderResult('', {
fetchMetrics: ctx.workStore.fetchMetrics,
fetchMetrics: workStore.fetchMetrics,
devRenderResumeDataCache: createRenderResumeDataCache(
prerenderResumeDataCache
),
......@@ -1341,6 +1357,12 @@ async function renderToHTMLOrFlightImpl(
const isActionRequest = getServerActionRequestMetadata(req).isServerAction
const implicitTags = await getImplicitTags(
workStore.page,
url,
fallbackRouteParams
)
const ctx: AppRenderContext = {
componentMod: ComponentMod,
url,
......@@ -1362,16 +1384,11 @@ async function renderToHTMLOrFlightImpl(
nonce,
res,
sharedContext,
implicitTags,
}
getTracer().setRootSpanAttribute('next.route', pagePath)
const implicitTags = await getImplicitTags(
workStore.page,
url,
fallbackRouteParams
)
if (isStaticGeneration) {
// We're either building or revalidating. In either case we need to
// prerender our page rather than render it.
......@@ -1392,8 +1409,7 @@ async function renderToHTMLOrFlightImpl(
ctx,
metadata,
workStore,
loaderTree,
implicitTags
loaderTree
)
// If we're debugging partial prerendering, print all the dynamic API accesses
......@@ -2215,12 +2231,16 @@ async function spawnDynamicValidationInDev(
route: string,
requestStore: RequestStore
): Promise<void> {
const { componentMod: ComponentMod } = ctx
const { componentMod: ComponentMod, implicitTags } = ctx
const rootParams = getRootParams(
ComponentMod.tree,
ctx.getDynamicParamFromSegment
)
const hmrRefreshHash = requestStore.cookies.get(
NEXT_HMR_REFRESH_HASH_COOKIE
)?.value
// Prerender controller represents the lifetime of the prerender.
// It will be aborted when a Task is complete or a synchronously aborting
// API is called. Notably during cache-filling renders this does not actually
......@@ -2238,7 +2258,7 @@ async function spawnDynamicValidationInDev(
type: 'prerender',
phase: 'render',
rootParams,
implicitTags: undefined,
implicitTags,
renderSignal: initialServerRenderController.signal,
controller: initialServerPrerenderController,
cacheSignal,
......@@ -2248,6 +2268,7 @@ async function spawnDynamicValidationInDev(
stale: INFINITE_CACHE,
tags: [],
prerenderResumeDataCache,
hmrRefreshHash,
}
const initialClientController = new AbortController()
......@@ -2255,7 +2276,7 @@ async function spawnDynamicValidationInDev(
type: 'prerender',
phase: 'render',
rootParams,
implicitTags: undefined,
implicitTags,
renderSignal: initialClientController.signal,
controller: initialClientController,
cacheSignal,
......@@ -2265,6 +2286,7 @@ async function spawnDynamicValidationInDev(
stale: INFINITE_CACHE,
tags: [],
prerenderResumeDataCache,
hmrRefreshHash,
}
// We're not going to use the result of this render because the only time it could be used
......@@ -2401,7 +2423,7 @@ async function spawnDynamicValidationInDev(
type: 'prerender',
phase: 'render',
rootParams,
implicitTags: undefined,
implicitTags,
renderSignal: finalServerController.signal,
controller: finalServerController,
// During the final prerender we don't need to track cache access so we omit the signal
......@@ -2412,6 +2434,7 @@ async function spawnDynamicValidationInDev(
stale: INFINITE_CACHE,
tags: [],
prerenderResumeDataCache,
hmrRefreshHash,
}
const finalClientController = new AbortController()
......@@ -2422,7 +2445,7 @@ async function spawnDynamicValidationInDev(
type: 'prerender',
phase: 'render',
rootParams,
implicitTags: undefined,
implicitTags,
renderSignal: finalClientController.signal,
controller: finalClientController,
// During the final prerender we don't need to track cache access so we omit the signal
......@@ -2433,6 +2456,7 @@ async function spawnDynamicValidationInDev(
stale: INFINITE_CACHE,
tags: [],
prerenderResumeDataCache,
hmrRefreshHash,
}
const finalServerPayload = await workUnitAsyncStorage.run(
......@@ -2592,16 +2616,23 @@ async function prerenderToStream(
ctx: AppRenderContext,
metadata: AppPageRenderResultMetadata,
workStore: WorkStore,
tree: LoaderTree,
implicitTags: ImplicitTags
tree: LoaderTree
): Promise<PrerenderToStreamResult> {
// When prerendering formState is always null. We still include it
// because some shared APIs expect a formState value and this is slightly
// more explicit than making it an optional function argument
const formState = null
const rootParams = getRootParams(tree, ctx.getDynamicParamFromSegment)
const renderOpts = ctx.renderOpts
const {
assetPrefix,
getDynamicParamFromSegment,
implicitTags,
nonce,
pagePath,
renderOpts,
} = ctx
const rootParams = getRootParams(tree, getDynamicParamFromSegment)
const ComponentMod = renderOpts.ComponentMod
// TODO: fix this typescript
const clientReferenceManifest = renderOpts.clientReferenceManifest!
......@@ -2610,7 +2641,7 @@ async function prerenderToStream(
const { ServerInsertedHTMLProvider, renderServerInsertedHTML } =
createServerInsertedHTML()
const { ServerInsertedMetadataProvider, getServerInsertedMetadata } =
createServerInsertedMetadata(ctx.nonce)
createServerInsertedMetadata(nonce)
const tracingMetadata = getTracedMetadata(
getTracer().getTracePropagationData(),
......@@ -2624,25 +2655,25 @@ async function prerenderToStream(
polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')
)
.map((polyfill) => ({
src: `${ctx.assetPrefix}/_next/${polyfill}${getAssetQueryString(
src: `${assetPrefix}/_next/${polyfill}${getAssetQueryString(
ctx,
false
)}`,
integrity: renderOpts.subresourceIntegrityManifest?.[polyfill],
crossOrigin: renderOpts.crossOrigin,
noModule: true,
nonce: ctx.nonce,
nonce: nonce,
}))
const [preinitScripts, bootstrapScript] = getRequiredScripts(
renderOpts.buildManifest,
// Why is assetPrefix optional on renderOpts?
// @TODO make it default empty string on renderOpts and get rid of it from ctx
ctx.assetPrefix,
assetPrefix,
renderOpts.crossOrigin,
renderOpts.subresourceIntegrityManifest,
getAssetQueryString(ctx, true),
ctx.nonce,
nonce,
renderOpts.page
)
......@@ -2759,6 +2790,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
})
// We're not going to use the result of this render because the only time it could be used
......@@ -2853,6 +2885,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
}
const prerender = require('react-dom/static.edge')
......@@ -2870,7 +2903,7 @@ async function prerenderToStream(
ServerInsertedMetadataProvider={
ServerInsertedMetadataProvider
}
nonce={ctx.nonce}
nonce={nonce}
/>,
{
signal: initialClientController.signal,
......@@ -2939,6 +2972,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
})
const finalAttemptRSCPayload = await workUnitAsyncStorage.run(
......@@ -3008,6 +3042,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
}
let clientIsDynamic = false
......@@ -3026,7 +3061,7 @@ async function prerenderToStream(
clientReferenceManifest={clientReferenceManifest}
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
ServerInsertedMetadataProvider={ServerInsertedMetadataProvider}
nonce={ctx.nonce}
nonce={nonce}
/>,
{
signal: finalClientController.signal,
......@@ -3151,13 +3186,13 @@ async function prerenderToStream(
clientReferenceManifest={clientReferenceManifest}
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
ServerInsertedMetadataProvider={ServerInsertedMetadataProvider}
nonce={ctx.nonce}
nonce={nonce}
/>,
JSON.parse(JSON.stringify(postponed)),
{
signal: createPostponedAbortSignal('static prerender resume'),
onError: htmlRendererErrorHandler,
nonce: ctx.nonce,
nonce,
}
)
......@@ -3171,7 +3206,7 @@ async function prerenderToStream(
stream: await continueStaticPrerender(htmlStream, {
inlinedDataStream: createInlinedDataReadableStream(
reactServerResult.consumeAsStream(),
ctx.nonce,
nonce,
formState
),
getServerInsertedHTML,
......@@ -3242,6 +3277,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
})
const initialClientController = new AbortController()
......@@ -3259,6 +3295,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
})
// We're not going to use the result of this render because the only time it could be used
......@@ -3340,7 +3377,7 @@ async function prerenderToStream(
clientReferenceManifest={clientReferenceManifest}
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
ServerInsertedMetadataProvider={ServerInsertedMetadataProvider}
nonce={ctx.nonce}
nonce={nonce}
/>,
{
signal: initialClientController.signal,
......@@ -3412,6 +3449,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
})
let clientIsDynamic = false
......@@ -3436,6 +3474,7 @@ async function prerenderToStream(
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache,
hmrRefreshHash: undefined,
})
const finalServerPayload = await workUnitAsyncStorage.run(
......@@ -3493,7 +3532,7 @@ async function prerenderToStream(
ServerInsertedMetadataProvider={
ServerInsertedMetadataProvider
}
nonce={ctx.nonce}
nonce={nonce}
/>,
{
signal: finalClientController.signal,
......@@ -3590,7 +3629,7 @@ async function prerenderToStream(
stream: await continueFizzStream(htmlStream!, {
inlinedDataStream: createInlinedDataReadableStream(
serverPrerenderStreamResult.asStream(),
ctx.nonce,
nonce,
formState
),
isStaticGeneration: true,
......@@ -3672,7 +3711,7 @@ async function prerenderToStream(
clientReferenceManifest={clientReferenceManifest}
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
ServerInsertedMetadataProvider={ServerInsertedMetadataProvider}
nonce={ctx.nonce}
nonce={nonce}
/>,
{
onError: htmlRendererErrorHandler,
......@@ -3804,13 +3843,13 @@ async function prerenderToStream(
clientReferenceManifest={clientReferenceManifest}
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
ServerInsertedMetadataProvider={ServerInsertedMetadataProvider}
nonce={ctx.nonce}
nonce={nonce}
/>,
JSON.parse(JSON.stringify(postponed)),
{
signal: createPostponedAbortSignal('static prerender resume'),
onError: htmlRendererErrorHandler,
nonce: ctx.nonce,
nonce,
}
)
......@@ -3824,7 +3863,7 @@ async function prerenderToStream(
stream: await continueStaticPrerender(htmlStream, {
inlinedDataStream: createInlinedDataReadableStream(
reactServerResult.consumeAsStream(),
ctx.nonce,
nonce,
formState
),
getServerInsertedHTML,
......@@ -3883,11 +3922,11 @@ async function prerenderToStream(
clientReferenceManifest={clientReferenceManifest}
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
ServerInsertedMetadataProvider={ServerInsertedMetadataProvider}
nonce={ctx.nonce}
nonce={nonce}
/>,
{
onError: htmlRendererErrorHandler,
nonce: ctx.nonce,
nonce,
bootstrapScripts: [bootstrapScript],
}
)
......@@ -3917,7 +3956,7 @@ async function prerenderToStream(
stream: await continueFizzStream(htmlStream, {
inlinedDataStream: createInlinedDataReadableStream(
reactServerResult.consumeAsStream(),
ctx.nonce,
nonce,
formState
),
isStaticGeneration: true,
......@@ -3958,7 +3997,7 @@ async function prerenderToStream(
if (shouldBailoutToCSR) {
const stack = getStackWithoutErrorMessage(err)
error(
`${err.reason} should be wrapped in a suspense boundary at page "${ctx.pagePath}". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n${stack}`
`${err.reason} should be wrapped in a suspense boundary at page "${pagePath}". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n${stack}`
)
throw err
......@@ -3991,11 +4030,11 @@ async function prerenderToStream(
const [errorPreinitScripts, errorBootstrapScript] = getRequiredScripts(
renderOpts.buildManifest,
ctx.assetPrefix,
assetPrefix,
renderOpts.crossOrigin,
renderOpts.subresourceIntegrityManifest,
getAssetQueryString(ctx, false),
ctx.nonce,
nonce,
'/_not-found/page'
)
......@@ -4047,11 +4086,11 @@ async function prerenderToStream(
ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}
preinitScripts={errorPreinitScripts}
clientReferenceManifest={clientReferenceManifest}
nonce={ctx.nonce}
nonce={nonce}
/>
),
streamOptions: {
nonce: ctx.nonce,
nonce,
// Include hydration scripts in the HTML
bootstrapScripts: [errorBootstrapScript],
formState,
......@@ -4089,7 +4128,7 @@ async function prerenderToStream(
stream: await continueFizzStream(fizzStream, {
inlinedDataStream: createInlinedDataReadableStream(
flightStream,
ctx.nonce,
nonce,
formState
),
isStaticGeneration: true,
......
......@@ -16,13 +16,14 @@ import type {
import type { Params } from '../request/params'
import type { ImplicitTags } from '../lib/implicit-tags'
import type { WorkStore } from './work-async-storage.external'
import { NEXT_HMR_REFRESH_HASH_COOKIE } from '../../client/components/app-router-headers'
export type WorkUnitPhase = 'action' | 'render' | 'after'
export interface CommonWorkUnitStore {
/** NOTE: Will be mutated as phases change */
phase: WorkUnitPhase
readonly implicitTags: ImplicitTags | undefined
readonly implicitTags: ImplicitTags
}
export interface RequestStore extends CommonWorkUnitStore {
......@@ -121,6 +122,13 @@ export interface PrerenderStoreModern extends CommonWorkUnitStore {
// not part of the primary render path and are just prerendering to produce
// validation results
validating?: boolean
/**
* The HMR refresh hash is only provided in dev mode. It is needed for the dev
* warmup render to ensure that the cache keys will be identical for the
* subsequent dynamic render.
*/
readonly hmrRefreshHash: string | undefined
}
export interface PrerenderStorePPR extends CommonWorkUnitStore {
......@@ -154,7 +162,16 @@ export type PrerenderStore =
| PrerenderStorePPR
| PrerenderStoreModern
export interface UseCacheStore extends CommonWorkUnitStore {
export interface CommonCacheStore
extends Omit<CommonWorkUnitStore, 'implicitTags'> {
/**
* A cache work unit store might not always have an outer work unit store,
* from which implicit tags could be inherited.
*/
readonly implicitTags: ImplicitTags | undefined
}
export interface UseCacheStore extends CommonCacheStore {
type: 'cache'
// Collected revalidate times and tags for this cache entry during the cache render.
revalidate: number // implicit revalidate time from inner caches / fetches
......@@ -173,7 +190,7 @@ export interface UseCacheStore extends CommonWorkUnitStore {
readonly draftMode: DraftModeProvider | undefined
}
export interface UnstableCacheStore extends CommonWorkUnitStore {
export interface UnstableCacheStore extends CommonCacheStore {
type: 'unstable-cache'
// Draft mode is only available if the outer work unit store is a request
// store and draft mode is enabled.
......@@ -276,10 +293,10 @@ export function getHmrRefreshHash(
return undefined
}
return workUnitStore.type === 'cache'
return workUnitStore.type === 'cache' || workUnitStore.type === 'prerender'
? workUnitStore.hmrRefreshHash
: workUnitStore.type === 'request'
? workUnitStore.cookies.get('__next_hmr_refresh_hash__')?.value
? workUnitStore.cookies.get(NEXT_HMR_REFRESH_HASH_COOKIE)?.value
: undefined
}
......
......@@ -68,7 +68,7 @@ type RequestContext = RequestResponsePair & {
renderOpts?: WrapperRenderOpts
isHmrRefresh?: boolean
serverComponentsHmrCache?: ServerComponentsHmrCache
implicitTags: ImplicitTags | undefined
implicitTags: ImplicitTags
}
type RequestResponsePair =
......
......@@ -393,6 +393,7 @@ export class AppRouteRouteModule extends RouteModule<
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache: null,
hmrRefreshHash: undefined,
})
let prospectiveResult
......@@ -478,6 +479,7 @@ export class AppRouteRouteModule extends RouteModule<
stale: INFINITE_CACHE,
tags: [...implicitTags.tags],
prerenderResumeDataCache: null,
hmrRefreshHash: undefined,
})
let responseHandled = false
......
......@@ -33,6 +33,7 @@ import { MiddlewareSpan } from '../lib/trace/constants'
import { CloseController } from './web-on-close'
import { getEdgePreviewProps } from './get-edge-preview-props'
import { getBuiltinRequestContext } from '../after/builtin-request-context'
import { getImplicitTags } from '../lib/implicit-tags'
export class NextRequestHint extends NextRequest {
sourcePage: string
......@@ -251,18 +252,26 @@ export async function adapter(
cookiesFromResponse = cookies
}
const previewProps = getEdgePreviewProps()
const page = '/' // Fake Work
const fallbackRouteParams = null
const implicitTags = await getImplicitTags(
page,
request.nextUrl,
fallbackRouteParams
)
const requestStore = createRequestStoreForAPI(
request,
request.nextUrl,
undefined,
implicitTags,
onUpdateCookies,
previewProps
)
const workStore = createWorkStore({
page: '/', // Fake Work
fallbackRouteParams: null,
page,
fallbackRouteParams,
renderOpts: {
cacheLifeProfiles:
params.request.nextConfig?.experimental?.cacheLife,
......
import { revalidatePath } from 'next/cache'
export async function GET() {
revalidatePath('/')
return Response.json({ revalidated: true })
}
......@@ -21,13 +21,21 @@ describe('dynamic-io-dev-warmup', () => {
it('logs with Prerender or Server environment depending based on whether the timing of when the log runs relative to this environment boundary', async () => {
let browser = await next.browser('/')
// At the moment this second render is required for the logs to resolves in the expected environment
// This doesn't reproduce locally but I suspect some kind of lazy initialization during dev that leads the initial render
// to not resolve in a microtask on the first render.
await browser.close()
browser = await next.browser('/')
let logs = await browser.log()
assertLog(logs, 'after layout cache read', 'Prerender')
assertLog(logs, 'after page cache read', 'Prerender')
assertLog(logs, 'after cached layout fetch', 'Prerender')
assertLog(logs, 'after cached page fetch', 'Prerender')
assertLog(logs, 'after uncached layout fetch', 'Server')
assertLog(logs, 'after uncached page fetch', 'Server')
const logs = await browser.log()
// After a revalidation the subsequent warmup render must discard stale
// cache entries.
await next.fetch('/revalidate')
browser = await next.browser('/')
logs = await browser.log()
assertLog(logs, 'after layout cache read', 'Prerender')
assertLog(logs, 'after page cache read', 'Prerender')
......
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