Engineering Decisions · Junior · Question 3 of 12
A popular blog gets its articles edited a few times a day. Search traffic matters, and text up to an hour old is fine. How do you render the pages?
- 1Render in the browser from a JSON API
- 2Render each page on the server per request
- 3Pre-render them and revalidate about hourly
Show the answer
Correct answer: Pre-render them and revalidate about hourly
Explanation
Pre-rendering with periodic revalidation serves fast cached HTML to readers and crawlers, and an hour of staleness is allowed here. Per-request rendering fits personalized pages or data that must be current on every visit, and here it would only add load. Client-side rendering fits private dashboards, but it makes the first paint slower and is a poor match for pages that depend on search.