Skip to content

fix(cache): skip disk writes for app 404 responses#94089

Open
bobu-putheeckal wants to merge 1 commit into
vercel:canaryfrom
bobu-putheeckal:codex/isr-not-found-no-disk-write
Open

fix(cache): skip disk writes for app 404 responses#94089
bobu-putheeckal wants to merge 1 commit into
vercel:canaryfrom
bobu-putheeckal:codex/isr-not-found-no-disk-write

Conversation

@bobu-putheeckal
Copy link
Copy Markdown

Closes #73101

Summary

  • Keep app page and app route 404 cache entries in memory but skip writing those generated 404 responses to disk.
  • Add unit coverage for the cache writer and a production ISR regression test that confirms notFound() responses do not create static artifacts.

Testing

  • PATH=./node_modules/.bin:/Users/c543982/.npm/_npx/179a5fd3f63fede5/node_modules/.bin:$PATH ./node_modules/.bin/jest --runInBand test/unit/incremental-cache/file-system-cache.test.ts
  • PATH=./node_modules/.bin:/Users/c543982/.npm/_npx/179a5fd3f63fede5/node_modules/.bin:$PATH scripts/run-jest.sh --mode=start --bundler=webpack --headless -- test/production/app-dir/isr-not-found-static-files/isr-not-found-static-files.test.ts
  • git diff --check
  • ./node_modules/.bin/prettier --check packages/next/src/server/lib/incremental-cache/file-system-cache.ts test/unit/incremental-cache/file-system-cache.test.ts test/production/app-dir/isr-not-found-static-files/isr-not-found-static-files.test.ts 'test/production/app-dir/isr-not-found-static-files/app/isr-not-found/[slug]/page.tsx' test/production/app-dir/isr-not-found-static-files/app/layout.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calling notFound() in ISR generates static files in app router.

1 participant