Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added links to data fetching api refs, fixed title #33221

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/basic-features/data-fetching/get-server-side-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -73,3 +73,10 @@ export async function getServerSideProps() {

export default Page
```

<div class="card">
<a href="/docs/api-reference/data-fetching/get-server-side-props.md">
<b>getServerSideProps API Reference</b>
<small>Read the API Reference for getServerSideProps</small>
</a>
</div>
7 changes: 7 additions & 0 deletions docs/basic-features/data-fetching/get-static-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<div class="card">
<a href="/docs/api-reference/data-fetching/get-static-paths.md">
<b>getStaticPaths API Reference</b>
<small>Read the API Reference for getStaticPaths</small>
</a>
</div>
7 changes: 7 additions & 0 deletions docs/basic-features/data-fetching/get-static-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<div class="card">
<a href="/docs/api-reference/data-fetching/get-static-props.md">
<b>getStaticProps API Reference</b>
<small>Read the API Reference for getStaticProps</small>
</a>
</div>