mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This introduces an experimental router flag (`experimental.staleTimes`)
to change the router cache behavior. Specifically:
```ts
// next.config.js
module.exports = {
experimental: {
staleTimes: {
dynamic: <seconds>,
static: <seconds>,
},
},
};
```
- `dynamic` is the value that is used when the `prefetch` `Link` prop is
left unspecified. (Default 30 seconds)
- `static` is the value that is used when the `prefetch` `Link` prop is
`true`. (Default 5 minutes)
Additional details:
- Loading boundaries are considered reusable for the time period
indicated by the `static` property (default 5 minutes)
- This doesn't disable partial rendering support, **meaning shared
layouts won't automatically be refetched every navigation, only the new
segment data**.
- This also doesn't change back/forward caching behavior to ensure
things like scroll restoration etc still work nicely.
Please see the original proposal
[here](https://github.com/vercel/next.js/discussions/54075#discussioncomment-6754339)
for more information. The primary difference is that this is a global
configuration, rather than a per-segment configuration, and it isn't
applied to layouts. (We expect this to be a "stop-gap" and not the final
router caching solution)
Closes NEXT-2703
83 lines
3.9 KiB
JSON
83 lines
3.9 KiB
JSON
{
|
|
"version": 2,
|
|
"suites": {
|
|
"test/e2e/app-dir/app-static/app-static.test.ts": {
|
|
"failed": [
|
|
"app-dir static/dynamic handling usePathname should have values from canonical url on rewrite",
|
|
"app-dir static/dynamic handling should have correct prerender-manifest entries",
|
|
"app-dir static/dynamic handling should output HTML/RSC files for static paths",
|
|
"app-dir static/dynamic handling should output debug info for static bailouts"
|
|
]
|
|
},
|
|
"test/e2e/app-dir/app-client-cache/client-cache.test.ts": {
|
|
"failed": [
|
|
"app dir client cache semantics prefetch={undefined} - default should re-use the full cache for only 30 seconds",
|
|
"app dir client cache semantics prefetch={undefined} - default should renew the 30s cache once the data is revalidated",
|
|
"app dir client cache semantics prefetch={undefined} - default should refetch the full page after 5 mins"
|
|
]
|
|
},
|
|
"test/e2e/app-dir/headers-static-bailout/headers-static-bailout.test.ts": {
|
|
"failed": [
|
|
"headers-static-bailout it provides a helpful link in case static generation bailout is uncaught"
|
|
]
|
|
},
|
|
"test/e2e/app-dir/error-boundary-navigation/override-node-env.test.ts": {
|
|
"failed": [
|
|
"app dir - not found navigation - with overridden node env should be able to navigate to other page from root not-found page"
|
|
]
|
|
},
|
|
"test/e2e/opentelemetry/opentelemetry.test.ts": {
|
|
"failed": [
|
|
"opentelemetry root context app router should handle RSC with fetch",
|
|
"opentelemetry incoming context propagation app router should handle RSC with fetch",
|
|
"opentelemetry incoming context propagation app router should handle route handlers in app router"
|
|
]
|
|
},
|
|
"test/e2e/app-dir/rsc-basic/rsc-basic.test.ts": {
|
|
"failed": [
|
|
"app dir - rsc basics should render initial styles of css-in-js in edge SSR correctly",
|
|
"app dir - rsc basics should render initial styles of css-in-js in nodejs SSR correctly",
|
|
"app dir - rsc basics should render server components correctly"
|
|
]
|
|
},
|
|
"test/e2e/app-dir/navigation/navigation.test.ts": {
|
|
"failed": [
|
|
"app dir - navigation redirect status code should respond with 308 status code if permanent flag is set",
|
|
"app dir - navigation redirect status code should respond with 307 status code in client component",
|
|
"app dir - navigation redirect status code should respond with 307 status code in server component",
|
|
"app dir - navigation bots should block rendering for bots and return 404 status"
|
|
]
|
|
},
|
|
"test/e2e/app-dir/app-static/app-static-custom-handler.test.ts": {
|
|
"failed": [
|
|
"app-dir static/dynamic handling should output debug info for static bailouts",
|
|
"app-dir static/dynamic handling should have correct prerender-manifest entries",
|
|
"app-dir static/dynamic handling should output HTML/RSC files for static paths"
|
|
]
|
|
},
|
|
"test/production/app-dir/unexpected-error/unexpected-error.test.ts": {
|
|
"failed": [
|
|
"unexpected-error should set response status to 500 for unexpected errors in ssr app route",
|
|
"unexpected-error should set response status to 500 for unexpected errors in isr app route"
|
|
]
|
|
}
|
|
},
|
|
"rules": {
|
|
"include": [
|
|
"test/e2e/**/*.test.{t,j}s{,x}",
|
|
"test/integration/app-*/**/*.test.{t,j}s{,x}",
|
|
"test/production/app-*/**/*.test.{t,j}s{,x}",
|
|
"test/development/app-*/**/*.test.{t,j}s{,x}"
|
|
],
|
|
"exclude": [
|
|
"test/integration/app-dir-export/**/*",
|
|
"test/e2e/app-dir/next-font/**/*",
|
|
"test/e2e/app-dir/ppr/**/*",
|
|
"test/e2e/app-dir/ppr-*/**/*",
|
|
"test/e2e/app-dir/app-prefetch*/**/*",
|
|
"test/e2e/app-dir/searchparams-static-bailout/searchparams-static-bailout.test.ts",
|
|
"test/e2e/app-dir/app-client-cache/client-cache.experimental.test.ts"
|
|
]
|
|
}
|
|
}
|