Skip to content
Open
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
8 changes: 8 additions & 0 deletions docs/01-app/01-getting-started/06-cache-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ Every incoming request would see different random numbers, date, etc.

> **Good to know**: You can cache non-deterministic operations with `use cache`. See the [with non-deterministic operations](#with-non-deterministic-operations) section for examples.

### Suspense misconception

A common misconception is that `<Suspense>` triggers request-time rendering. This is not the case:

- **Suspense does not defer rendering to request time.** Its role is to define a boundary for fallback UI while async content is being prepared or streamed.
- Components inside `<Suspense>` can still execute at build/prerender time if they have no runtime dependencies.
- Only Dynamic APIs or [`connection()`](/docs/app/api-reference/functions/connection) force request-time execution.
Comment on lines +248 to +252
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A common misconception is that `<Suspense>` triggers request-time rendering. This is not the case:
- **Suspense does not defer rendering to request time.** Its role is to define a boundary for fallback UI while async content is being prepared or streamed.
- Components inside `<Suspense>` can still execute at build/prerender time if they have no runtime dependencies.
- Only Dynamic APIs or [`connection()`](/docs/app/api-reference/functions/connection) force request-time execution.
A common misconception is that `<Suspense>` automatically triggers request-time rendering. This is not the case:
- **Suspense alone does not force request-time rendering.** While Suspense defines a boundary for fallback UI, the actual deferral to request time only happens when components access Dynamic APIs or [`connection()`](/docs/app/api-reference/functions/connection). Components inside `<Suspense>` can still execute at build/prerender time if they have no runtime dependencies.
- Only Dynamic APIs or [`connection()`](/docs/app/api-reference/functions/connection) actually trigger request-time execution. Wrapping a component in `<Suspense>` without these dependencies doesn't defer its rendering.

The new section contradicts earlier documentation that explicitly states Suspense is used to "defer rendering to request time." The wording should be clarified to distinguish between Suspense being a mechanism for deferred rendering versus being a trigger for it.

View Details

Analysis

Documentation contradiction: Suspense and deferred rendering

What fails: Section "Suspense misconception" contradicts earlier documentation about Suspense and request-time rendering.

How to reproduce: Read the document:

  • Line 36: "Defer rendering to request time by wrapping components in React's <Suspense>"
  • Line 91: "To defer rendering to request time, a parent component must provide fallback UI using a Suspense boundary"
  • Line 250: "Suspense does not defer rendering to request time"

Result: The statement at line 250 directly contradicts the usage pattern documented in lines 36 and 91.

Expected: The documentation should clarify that Suspense is the mechanism for deferring rendering (you wrap components in Suspense to defer them), but Suspense alone doesn't automatically trigger request-time rendering without runtime dependencies (Dynamic APIs, connection(), etc.).

Fix: Changed line 250 from "Suspense does not defer rendering to request time" to "Suspense alone does not force request-time rendering" and clarified that the actual trigger is Dynamic APIs or connection(), not Suspense itself. This preserves the misconception clarification while maintaining consistency with earlier documentation.


## Using `use cache`

The [`use cache`](/docs/app/api-reference/directives/use-cache) directive caches the return value of async functions and components. You can apply it at the function, component, or file level.
Expand Down
Loading