playbook/antigravity-awesome-skills/plugins/antigravity-awesome-skills-.../skills/vercel-optimize/references/support-topics/cache-components-suspense-d...

1.3 KiB

id title status candidateKinds frameworks scannerPatterns priority citations maxBriefChars
cache-components-suspense-dedupe-pitfall Cache Components Suspense dedupe pitfall active
cache_components_suspense_dedupe
next@>=16.0.0
cache-components-suspense-dedupe
87
https://nextjs.org/docs/app/api-reference/directives/use-cache
https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents
https://nextjs.org/docs/app/guides/migrating-to-cache-components
900

Investigation Brief

Default 'use cache' does not dedupe identical calls across separate <Suspense> boundaries on the same render. Each boundary re-invokes the cached function, multiplying function-duration and ISR write churn.

Evidence To Check

Confirm the scanner finding's repeated fetch URL or helper name. Verify the call sites are within the same route segment and inside distinct <Suspense> boundaries. Cross-reference fnDurationP95ByRoute and isrWritesByRoute for the owning route.

Do Not Recommend When

Skip if the repeated call is intentional (different parameters, different intent). Skip if the duplicate is in a single component body where in-request memoization already applies.

Verification

Name the duplicated call, count, and either: (a) the page-level promise to hoist or (b) the function to move to 'use cache: remote'.