Load, change, and refresh data
Next.js Notes notes about Load, change, and refresh data
Load, change, and refresh data
Fetch Build-Time Data with `getStaticProps` in a Pages Router Page
Use `getStaticProps` to fetch posts before requests arrive and pass them to a Pages Router page as serializable props.
Load, change, and refresh data
Why Is My Next.js App Router Data Still Stale? Find the Cache Layer
Identify whether stale data comes from a cached fetch, rendered output, or a CDN response before choosing how to refresh it.
Load, change, and refresh data
Does Next.js Cache Images? Fix a Stale `next/image`
Find the image response your browser displays, check whether its source is current, then choose a freshness strategy for the cache that serves it.
Load, change, and refresh data
Fetch API Data in a Next.js Client Component with TanStack Query
Use TanStack Query to request posts from an existing API endpoint and render pending, error, empty, and populated states.
Load, change, and refresh data
Build and Call an API Endpoint with Next.js App Router Route Handlers
Create a GET and POST endpoint at /api/todos, call it with fetch, and check its JSON responses and status codes.





