Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ISR revalidateTag handling #53595

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ export default class FileSystemCache implements CacheHandler {
(data?.lastModified || Date.now())
)
})

// we trigger a blocking validation if an ISR page
// had a tag revalidated, if we want to be a background
// revalidation instead we return data.lastModified = -1
if (isStale) {
data.lastModified = -1
data = undefined
}
}

Expand Down
5 changes: 5 additions & 0 deletions test/e2e/app-dir/app-static/app-static.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ createNextDescribe(
const newRes = await next.fetch(
'/variable-revalidate/revalidate-360'
)
const cacheHeader = newRes.headers.get('x-nextjs-cache')

if ((global as any).isNextStart && cacheHeader) {
expect(cacheHeader).toBe('MISS')
}
const newHtml = await newRes.text()
const new$ = cheerio.load(newHtml)
const newLayoutData = new$('#layout-data').text()
Expand Down