mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
During a Full prefetch (`<Link prefetch={true}>`), check the bfcache for
matching segment data before issuing a new request. The bfcache stores
data from previous navigations, which always includes dynamic data.
This optimization avoids redundant server requests when the user has
already navigated to a route and the data is still fresh according to
the staleTimes.dynamic configuration.
20 lines
438 B
TypeScript
20 lines
438 B
TypeScript
import Link from 'next/link'
|
|
import { LinkAccordion } from '../components/link-accordion'
|
|
|
|
export default function Page() {
|
|
return (
|
|
<ul>
|
|
<li>
|
|
<LinkAccordion href="/dynamic" prefetch={true}>
|
|
Dynamic page
|
|
</LinkAccordion>
|
|
</li>
|
|
<li>
|
|
<Link href="/dynamic" prefetch={false} id="link-without-prefetch">
|
|
Dynamic page (no prefetch)
|
|
</Link>
|
|
</li>
|
|
</ul>
|
|
)
|
|
}
|