mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Adds a field `navigatedAt` to the CacheNode type. It represents the timestamp of the navigation that last updated the CacheNode's data. This will be used to implement the `staleTimes.dynamic` configuration option, which allows dynamic data to be stale in the UI up to the given threshold. This first PR adds the field without changing any behavior. Originally I was going to call this `requestedAt`, but I have intentionally chosen not to distinguish between whether the data was fetched from the network or from the prefetch cache. This means that even fully static data will respect the `staleTimes.dynamic` configuration option. In practice, this only matters if the dynamic stale time is longer than the static one, although usually static stale times will be larger anyway.
16 lines
304 B
TypeScript
16 lines
304 B
TypeScript
import { Suspense } from 'react'
|
|
import { connection } from 'next/server'
|
|
|
|
async function Content() {
|
|
await connection()
|
|
return <div id="dynamic-content">Dynamic content</div>
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Suspense fallback="Loading...">
|
|
<Content />
|
|
</Suspense>
|
|
)
|
|
}
|