Update unstable_cache docs for revalidate option (#62689)
Clarifies what passing false or undefined to the revalidate property option of unstable_cache does. Context: I didn't want my DB query to be cached at all, but I did use this API because I wanted to refresh a component's data after submitting a server action. I thought I had to pass 0, or false to get it to not cache at all. Co-authored-by: Sam Ko <sam@vercel.com>
This commit is contained in:
parent
24b7175dcf
commit
b1089d3691
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ const data = unstable_cache(fetchData, keyParts, options)()
|
|||
- `keyParts`: This is an array that identifies the cached key. It must contain globally unique values that together identify the key of the data being cached. The cache key also includes the arguments passed to the function.
|
||||
- `options`: This is an object that controls how the cache behaves. It can contain the following properties:
|
||||
- `tags`: An array of tags that can be used to control cache invalidation.
|
||||
- `revalidate`: The number of seconds after which the cache should be revalidated.
|
||||
- `revalidate`: The number of seconds after which the cache should be revalidated. Omit or pass `false` to cache indefinitely or until matching `revalidateTag()` or `revalidatePath()` methods are called.
|
||||
|
||||
## Returns
|
||||
|
||||
|
|
Loading…
Reference in a new issue