Skip to content

Commit daf5f06

Browse files
authored
Merge branch 'canary' into jude/match-swc-native-with-nextjs
2 parents 04b6810 + 61dbe6f commit daf5f06

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/02-app/02-api-reference/01-directives/use-cache.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const nextConfig = {
160160
biweekly: {
161161
stale: 60 * 60 * 24 * 14, // 14 days
162162
revalidate: 60 * 60 * 24, // 1 day
163-
expire: 86400 60 * 60 * 24 * 14, // 14 days
163+
expire: 60 * 60 * 24 * 14, // 14 days
164164
},
165165
},
166166
},
@@ -268,7 +268,7 @@ A `cacheTag` is used in combination with [`revalidateTag`](/docs/app/api-referen
268268

269269
In the below example the `getData` function uses the “weeks” cache profile, and defines a `cacheTag` on the functions cached output:
270270

271-
```tsx filename="app/actions.ts" highlight={4,5}
271+
```tsx filename="app/actions.ts" highlight={8,9}
272272
import {
273273
unstable_cacheTag as cacheTag,
274274
unstable_cacheLife as cacheLife,
@@ -286,7 +286,7 @@ export async function getData() {
286286

287287
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):
288288

289-
```tsx filename="app/submit.ts" highlight={4,5}
289+
```tsx filename="app/submit.ts" highlight={6,7}
290290
'use server'
291291

292292
import { revalidateTag } from 'next/cache'
@@ -311,7 +311,7 @@ This is recommended for applications that previously used the [`export const dyn
311311

312312
```tsx filename="app/layout.tsx"
313313
"use cache"
314-
import { unstable_cacheLife as cacheLife} from 'next/cache'
314+
import { unstable_cacheLife as cacheLife } from 'next/cache'
315315
cacheLife('minutes')
316316

317317
export default Layout({children}: {children: ReactNode}) {
@@ -323,7 +323,7 @@ And in your `page.tsx` file you can add the `use cache` directive to the top of
323323

324324
```tsx filename="app/page.tsx"
325325
"use cache"
326-
import { unstable_cacheLife as cacheLife} from 'next/cache'
326+
import { unstable_cacheLife as cacheLife } from 'next/cache'
327327
cacheLife('minutes')
328328

329329
async function Users() {
@@ -346,7 +346,7 @@ You can use `use cache` at the component level to cache any fetches or computati
346346

347347
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.
348348

349-
```tsx filename="app/components/bookings.tsx" highlight={4,5}
349+
```tsx filename="app/components/bookings.tsx" highlight={8,9}
350350
import { unstable_cacheLife as cacheLife } from 'next/cache'
351351

352352
interface BookingsProps {

0 commit comments

Comments
 (0)