Unverified Commit b1089d36 authored by Wes Bos's avatar Wes Bos Committed by GitHub

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: 's avatarSam Ko <sam@vercel.com>
parent 24b7175d
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment