Next.js Developer interview question
Design the caching strategy for a Next.js e-commerce site with product pages, a cart and personalised recommendations.
Design Asked in Frontend Engineer · Full Stack Engineer interviews
Summary
Cache what's shared and change it on events: statically render or cache product and category pages and revalidate them by tag when a product changes; keep the cart and anything personal dynamic and uncached; stream personalised recommendations in a separate dynamic section so the rest of the page stays cached. Put a CDN in front for assets and cacheable HTML.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More Next.js Developer questions
- How did caching defaults change in Next.js 15?
- Explain SSR, SSG, ISR and CSR in Next.js.
- How does data fetching work in the App Router?
- What is the difference between Server Components and Client Components?
- What is Next.js and what problems does it solve on top of React?
- Explain the App Router file conventions: page, layout, loading, error, not-found, template and route.
- What are the differences between the App Router and the Pages Router?
- What are Server Actions and how do you use them for mutations?