0312d4a1a9
### What When a route handler uses an API that opts it into dynamic rendering (such as `no-store` on a fetch), and also specifies a `revalidate` time, the `revalidate` time is ignored and route is treated as fully static. ### Why `revalidate: 0` and `revalidate: false` have different semantic meanings: `false` essentially means cache forever, whereas `0` means it's dynamic. Since `0` is also falsey, the code we have to fallback with a default `revalidate` value for route handlers is incorrectly not marking the route as dynamic, and as a result, caching the route without an expiration time. ### How This updates the fallback handling for app routes respect a revalidation value of `0`, so that the page can properly be marked dynamic. ### Test Explanation This adds 2 new routes handlers: both have a revalidation time specified & use `no-store` on a fetch, but only one of them specifies `export const dynamic = 'force-static'`. The one that doesn't specify `force-static` is correctly omitted from the prerender manifest. The one that is `force-static` is correctly in the prerender manifest with the right expiration time. An additional test case was added to verify that this data refreshes after the specified interval. Closes NEXT-2764 |
||
---|---|---|
.. | ||
.stats-app | ||
development | ||
e2e | ||
examples | ||
integration | ||
lib | ||
production | ||
unit | ||
.gitignore | ||
build-turbopack-tests-manifest.d.ts | ||
build-turbopack-tests-manifest.js | ||
get-test-filter.js | ||
jest-setup-after-env.ts | ||
ppr-tests-manifest.json | ||
readme.md | ||
test-file.txt | ||
tsconfig.json | ||
turbopack-tests-manifest.json |