You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/02-app/02-api-reference/01-directives/use-cache.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,7 +160,7 @@ const nextConfig = {
160
160
biweekly: {
161
161
stale: 60*60*24*14, // 14 days
162
162
revalidate: 60*60*24, // 1 day
163
-
expire: 8640060*60*24*14, // 14 days
163
+
expire: 60*60*24*14, // 14 days
164
164
},
165
165
},
166
166
},
@@ -268,7 +268,7 @@ A `cacheTag` is used in combination with [`revalidateTag`](/docs/app/api-referen
268
268
269
269
In the below example the `getData` function uses the “weeks” cache profile, and defines a `cacheTag` on the functions cached output:
270
270
271
-
```tsx filename="app/actions.ts" highlight={4,5}
271
+
```tsx filename="app/actions.ts" highlight={8,9}
272
272
import {
273
273
unstable_cacheTagascacheTag,
274
274
unstable_cacheLifeascacheLife,
@@ -286,7 +286,7 @@ export async function getData() {
286
286
287
287
You can then purge the cache on-demand using revalidateTag in another function, for examples, a [route handler](/docs/app/building-your-application/routing/route-handlers) or [Server Action](/docs/app/building-your-application/data-fetching/server-actions-and-mutations):
288
288
289
-
```tsx filename="app/submit.ts" highlight={4,5}
289
+
```tsx filename="app/submit.ts" highlight={6,7}
290
290
'use server'
291
291
292
292
import { revalidateTag } from'next/cache'
@@ -311,7 +311,7 @@ This is recommended for applications that previously used the [`export const dyn
@@ -346,7 +346,7 @@ You can use `use cache` at the component level to cache any fetches or computati
346
346
347
347
The props are serialized and form part of the cache key. If you use the same component in multiple places in your application, the cache entry will be reused as long as the serialized props produce the same value in each instance.
0 commit comments