System Design · Senior · Question 32 of 75
How do you combine CDN caching of HTML with personalization (username, cart)?
- ✓Correct answer: Cache the shell and stream personal parts separately
- 2Disable HTML caching for all pages
- 3Cache HTML separately for each user on the CDN
Explanation
Partial Prerendering, Edge Side Includes or client-side loading: the static part is served instantly from the CDN, and personal fragments are filled in on request. A per-user cache kills CDN efficiency and risks leaks.