CodePark/ questions / Performance at scale
START PRACTICINGPRACTICE
Frontend question · Frontend system design › Performance at scale

You are building an e-commerce product detail page. It must rank in search, prices change a few times a day, and there are 2 million products. Which rendering strategy fits best?

Static or cached server rendering with time-based or on-demand revalidation

Static or cached server rendering with revalidation fits best. One example is ISR (Incremental Static Regeneration): a page is built on its first request, cached, then rebuilt on a timer or on demand. A cached SSR (server-side rendering) response also works. Both give fast HTML that search engines can crawl. They refresh when prices change, and they generate pages on first request instead of all at build time. "Static generation of all 2 million pages at every deploy" is the tempting wrong answer, because building 2 million pages each deploy is too slow. "Server rendering on every request with no caching" is also wrong, because it pays the full server cost on every view.