From 260361a9bc3cbd7d34ae61c8f6283d805548b023 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Mon, 1 Mar 2021 19:00:33 -0600 Subject: [PATCH 1/3] Add note about preloading to routing introduction. --- docs/routing/introduction.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/routing/introduction.md b/docs/routing/introduction.md index 8545a00277e5d..56e0014f48a9e 100644 --- a/docs/routing/introduction.md +++ b/docs/routing/introduction.md @@ -74,6 +74,8 @@ In the example above we have multiple links, each one maps a path (`href`) to a - `/about` → `pages/about.js` - `/blog/hello-world` → `pages/blog/[slug].js` +Any `` in the viewport (initially or through scroll) will be preloaded by default for pages using [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation). Server-rendered routes are _not_ preloaded. + ### Linking to dynamic paths You can also use interpolation to create the path, which comes in handy for [dynamic route segments](#dynamic-route-segments). For example, to show a list of posts which have been passed to the component as a prop: From 19cbf4deb87becbe56f91bff7409ccaac4e135cc Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Mon, 1 Mar 2021 21:11:47 -0600 Subject: [PATCH 2/3] Update docs/routing/introduction.md Co-authored-by: JJ Kasper --- docs/routing/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/routing/introduction.md b/docs/routing/introduction.md index 56e0014f48a9e..cf818854985f9 100644 --- a/docs/routing/introduction.md +++ b/docs/routing/introduction.md @@ -74,7 +74,7 @@ In the example above we have multiple links, each one maps a path (`href`) to a - `/about` → `pages/about.js` - `/blog/hello-world` → `pages/blog/[slug].js` -Any `` in the viewport (initially or through scroll) will be preloaded by default for pages using [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation). Server-rendered routes are _not_ preloaded. +Any `` in the viewport (initially or through scroll) will be prefetched by default including the corresponding data for pages using [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation). The corresponding data for [server-rendered](https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering) routes is _not_ prefetched. ### Linking to dynamic paths From 0a7546fc3d81f2a89061cad238c2175107ba4bd0 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Mon, 1 Mar 2021 21:12:09 -0600 Subject: [PATCH 3/3] Update docs/routing/introduction.md --- docs/routing/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/routing/introduction.md b/docs/routing/introduction.md index cf818854985f9..575c65db1792f 100644 --- a/docs/routing/introduction.md +++ b/docs/routing/introduction.md @@ -74,7 +74,7 @@ In the example above we have multiple links, each one maps a path (`href`) to a - `/about` → `pages/about.js` - `/blog/hello-world` → `pages/blog/[slug].js` -Any `` in the viewport (initially or through scroll) will be prefetched by default including the corresponding data for pages using [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation). The corresponding data for [server-rendered](https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering) routes is _not_ prefetched. +Any `` in the viewport (initially or through scroll) will be prefetched by default (including the corresponding data) for pages using [Static Generation](/docs/basic-features/data-fetching.md#getstaticprops-static-generation). The corresponding data for [server-rendered](https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering) routes is _not_ prefetched. ### Linking to dynamic paths