All quizzesHard
Next.js Expert — Series 2
Preview — 3 of 10 questions
What is a multi-zone Next.js deployment?
ADeploying the same app to several cloud availability zones for redundancy
BSplitting a large product into multiple independent Next.js apps, each owning a URL path prefix (/docs, /blog), stitched together with rewrites so users see one domain while teams build and deploy separately
CRunning dev, build, and production as three processes
DA Prisma database sharding strategy
How do you serve two page variants at the same URL via middleware, without the URL changing?
AIn middleware.ts, assign a bucket via a cookie and use NextResponse.rewrite() to internally serve /page-b's content for a URL the browser still shows as /page
BCall redirect() in the page component for half the users
CDeploy two instances behind a load balancer
DSet export const variant = 'B' in page.tsx for 50% of builds
How do you redirect a visitor to a locale prefix based on their inferred country?
ACall a third-party geo-IP HTTP API synchronously on every request
BSet export const locales = [...] in next.config.ts and let Next.js redirect automatically
CRead the platform's geolocation (e.g. request.headers.get('x-vercel-ip-country'), or geolocation(request) from @vercel/functions) and issue NextResponse.redirect() to the matching locale prefix when the path has none
DUse navigator.geolocation in a Server Component
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.