From 22eca10c6a4cc5e5531ddb23f70043eaa67d2c38 Mon Sep 17 00:00:00 2001 From: Rich Haines Date: Wed, 12 Jan 2022 16:52:55 +0100 Subject: [PATCH] Added links to data fetching api refs, fixed title (#33221) This PR adds links from the data fetching api pages to their api ref pages. Also removes rouge backticks on header ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` --- .../data-fetching/get-server-side-props.md | 9 ++++++++- docs/basic-features/data-fetching/get-static-paths.md | 7 +++++++ docs/basic-features/data-fetching/get-static-props.md | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/basic-features/data-fetching/get-server-side-props.md b/docs/basic-features/data-fetching/get-server-side-props.md index 6caea00e656c..8aa844221785 100644 --- a/docs/basic-features/data-fetching/get-server-side-props.md +++ b/docs/basic-features/data-fetching/get-server-side-props.md @@ -31,7 +31,7 @@ Note that you must export `getServerSideProps` as a standalone function — it w The [`getServerSideProps` API reference](/docs/api-reference/data-fetching/get-server-side-props.md) covers all parameters and props that can be used with `getServerSideProps`. -## When should I use `getServerSideProps`? +## When should I use getServerSideProps You should use `getServerSideProps` only if you need to pre-render a page whose data must be fetched at request time. [Time to First Byte (TTFB)](/learn/seo/web-performance) will be higher than [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md) because the server must compute the result on every request, and the result can only be cached by a CDN using `cache-control` headers (which could require extra configuration). @@ -73,3 +73,10 @@ export async function getServerSideProps() { export default Page ``` + +
+ + getServerSideProps API Reference + Read the API Reference for getServerSideProps + +
diff --git a/docs/basic-features/data-fetching/get-static-paths.md b/docs/basic-features/data-fetching/get-static-paths.md index e83f195a348d..cb9b5b68b438 100644 --- a/docs/basic-features/data-fetching/get-static-paths.md +++ b/docs/basic-features/data-fetching/get-static-paths.md @@ -46,3 +46,10 @@ Note that you must use export `getStaticPaths` as a standalone function — it w ## Runs on every request in development In development (`next dev`), `getStaticPaths` will be called on every request. + +
+ + getStaticPaths API Reference + Read the API Reference for getStaticPaths + +
diff --git a/docs/basic-features/data-fetching/get-static-props.md b/docs/basic-features/data-fetching/get-static-props.md index 1e5319e34c21..96bad22811c3 100644 --- a/docs/basic-features/data-fetching/get-static-props.md +++ b/docs/basic-features/data-fetching/get-static-props.md @@ -101,3 +101,10 @@ In development (`next dev`), `getStaticProps` will be called on every request. In some cases, you might want to temporarily bypass Static Generation and render the page at **request time** instead of build time. For example, you might be using a headless CMS and want to preview drafts before they're published. This use case is supported in Next.js by the [**Preview Mode**](/docs/advanced-features/preview-mode.md) feature. + +
+ + getStaticProps API Reference + Read the API Reference for getStaticProps + +