nextjs-data-fetching
Installation
SKILL.md
Data Fetching (App Router)
Priority: P0 (CRITICAL)
[!WARNING] Covers App Router
fetchonly. Forpages/directory: usegetServerSideProps/getStaticProps. Ignore nativefetchcaching advice below.
Fetch data directly in Server Components using async/await.
Strategies
- Static: Build-time.
fetch(url, { cache: 'force-cache' }). - Dynamic: Request-time.
fetch(url, { cache: 'no-store' })orcookies(). - Revalidated:
fetch(url, { next: { revalidate: 60 } }).