Skip to content

Commit 347c8df

Browse files
authored
docs: use cache debugging notes (#86937)
Closes: #86896
1 parent ac8d891 commit 347c8df

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,24 @@ export default function ClientComponent({ action }) {
518518

519519
## Troubleshooting
520520

521+
### Debugging cache behavior
522+
523+
#### Verbose logging
524+
525+
Set `NEXT_PRIVATE_DEBUG_CACHE=1` for verbose cache logging:
526+
527+
```bash
528+
NEXT_PRIVATE_DEBUG_CACHE=1 npm run dev
529+
# or for production
530+
NEXT_PRIVATE_DEBUG_CACHE=1 npm run start
531+
```
532+
533+
> **Good to know:** This environment variable also logs ISR and other caching mechanisms. See [Verifying correct production behavior](/docs/app/guides/incremental-static-regeneration#verifying-correct-production-behavior) for more details.
534+
535+
#### Console log replays
536+
537+
In development, console logs from cached functions appear with a `Cache` prefix.
538+
521539
### Build Hangs (Cache Timeout)
522540

523541
If your build hangs, you're accessing Promises that resolve to dynamic or runtime data, created outside a `use cache` boundary. The cached function waits for data that can't resolve during the build, causing a timeout after 50 seconds.

0 commit comments

Comments
 (0)