
Next.js Data Fetching
Server-side rendering (SSR), static generation (SSG), incremental static regeneration (ISR), streaming
1What is the default behavior of Server Components in Next.js App Router for data fetching?
What is the default behavior of Server Components in Next.js App Router for data fetching?
Answer
Server Components perform data fetching on the server with each request by default, ensuring fresh data. Unlike Pages Router where getServerSideProps was needed, Server Components make SSR implicit. For static caching, the cache: 'force-cache' option must be added to fetch.
2Which fetch cache option is equivalent to getStaticProps in Pages Router?
Which fetch cache option is equivalent to getStaticProps in Pages Router?
Answer
The cache: 'force-cache' option tells Next.js to cache the response until manually invalidated, equivalent to getStaticProps. This strategy generates static content that remains cached indefinitely. The 'no-store' option equals getServerSideProps (re-fetch every request), while next.revalidate equals getStaticProps with revalidate (ISR).
3How to force dynamic data fetching on every request (getServerSideProps equivalent)?
How to force dynamic data fetching on every request (getServerSideProps equivalent)?
Answer
The cache: 'no-store' option completely disables caching and forces re-fetching on every request, equivalent to getServerSideProps. This strategy ensures always fresh data but increases latency. Use for real-time data (dashboards, notifications, live prices) where freshness is critical.
How to implement ISR (Incremental Static Regeneration) with hourly revalidation?
What does 'export const revalidate = 60' export at page level do?
+21 interview questions
Other React / Next.js interview topics
JavaScript Essentials
React Fundamentals
React Hooks
Component Lifecycle
React Router
State Management with Context
Forms & Controlled Components
Data Fetching & API
React Query (TanStack Query)
Styling & CSS-in-JS
Next.js Fundamentals
TypeScript with React
Next.js Server Actions
Next.js Routing & Navigation
Next.js API Routes
Next.js Metadata & SEO
Next.js Middleware & Auth
React Testing
Zustand State Management
React Performance Optimization
Error Boundaries & Error Handling
Advanced React Patterns
Next.js Advanced Features
Next.js Deployment & Production
Architecture & Design Patterns
React Server Components
Next.js Internationalization
React Security & Best Practices
Master React / Next.js for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free