Docs: Fix typo (#66749)

Fix typo in `unstable_cache` API page. re:
https://github.com/vercel/next.js/pull/66716
This commit is contained in:
Delba de Oliveira 2024-06-11 14:30:42 +01:00 committed by GitHub
parent 8bac76a5b3
commit db9170c2b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,7 +68,7 @@ export default function Layout({ children }) {
The use case for `unstable_after()` is to process secondary tasks without blocking the primary response. It's similar to using the platform's [`waitUntil()`](https://vercel.com/docs/functions/functions-api-reference) or removing `await` from a promise, but with the following differences:
- **[`waitUntil()`]**: accepts promise and enqueues a task to be executed during the lifecycle of the request, whereas `unstable_after()` accepts a callback that will be executed **after** the response is finished.
- **`waitUntil()`**: accepts a promise and enqueues a task to be executed during the lifecycle of the request, whereas `unstable_after()` accepts a callback that will be executed **after** the response is finished.
- **Removing `await`**: starts executing during the response, which uses resources. It's also not reliable in serverless environments as the function stops computation immediately after the response is sent, potentially interrupting the task.
We recommend using `unstable_after()` as it has been designed to consider other Next.js APIs and contexts.