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/01-app/03-api-reference/01-directives/use-cache-private.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,13 +197,13 @@ This ensures user-specific data is never accidentally shared between users while
197
197
> **Note:** Functions with a `cacheLife` stale time less than 30 seconds will not be runtime prefetched, even when using `'use cache: private'`. This prevents prefetching of rapidly changing data that would likely be stale by navigation time.
198
198
199
199
```tsx
200
-
//✅ Will be runtime prefetched (stale ≥ 30s)
200
+
// Will be runtime prefetched (stale ≥ 30s)
201
201
cacheLife({ stale:60 })
202
202
203
-
//✅ Will be runtime prefetched (stale ≥ 30s)
203
+
// Will be runtime prefetched (stale ≥ 30s)
204
204
cacheLife({ stale:30 })
205
205
206
-
//❌ Will NOT be runtime prefetched (stale < 30s)
206
+
// Will NOT be runtime prefetched (stale < 30s)
207
207
cacheLife({ stale:10 })
208
208
```
209
209
@@ -213,20 +213,20 @@ The following request-specific APIs can be used inside `'use cache: private'` fu
213
213
214
214
| API | Allowed in `use cache` | Allowed in `'use cache: private'` |
> **Note:** The `connection()` API is prohibited in both `use cache` and `'use cache: private'` as it provides connection-specific information that cannot be safely cached.
222
222
223
223
## Nesting rules
224
224
225
225
Private caches have specific nesting rules to prevent cache pollution:
226
226
227
-
- ✅ Private caches **can** be nested inside other private caches
228
-
- ❌ Private caches **cannot** be nested inside public caches
229
-
- ✅ Public caches **can** be nested inside private caches
227
+
- Private caches **can** be nested inside other private caches
228
+
- Private caches **cannot** be nested inside public caches
229
+
- Public caches **can** be nested inside private caches
230
230
231
231
```tsx
232
232
// ✅ VALID: Private inside private
@@ -241,7 +241,7 @@ async function innerPrivate() {
0 commit comments