All jobs / Frontend / web developer / Performance
Frontend / web developer interview question · 5+ years
Personalized HTML at the edge versus cache hit ratio — how do you decide?
The strongest answer
Cache the shared shell, vary on explicit keys, and keep personal data in the client or short-lived fragments — never cache Set-Cookie HTML as public
Why it works
Edge helps when the key is honest. Personal HTML in a shared cache is a privacy incident.
What a good answer covers
- Cache what is shareable.
- Vary on explicit keys only.
- Personal bits stay private or uncached.
- Never store Set-Cookie HTML as public.
Answers that fall short
- Close, but not the strongest: Cache everything at the edge, including user names
User names in a public cache leak across sessions. - Weak: No cache; SSR every hit
No cache is simple and expensive at peak. - Red flag: Cache authenticated HTML on a public CDN path
Public authenticated HTML is a class of breach.
Who gets asked this
More Performance questions
- How does a frontend platform prove it is not making products slower?
- Images pop the page down as they load. What do you set and why?
- The main bundle includes an admin charts page most visitors never open. What do you do?
- When would you render a marketing homepage on the server versus a settings screen on the client?
- A late-loading banner pushes content down (CLS). How do you prevent it?
- LCP is a hero image. What do you change first?
- Clicking Filter freezes the tab for about 400ms. How do you investigate?
- Product asks if the new home is faster. What do you report?