All jobs / Full-stack developer / System Design Basics

Full-stack developer interview question · 5+ years

Someone enabled the CDN in front of the API and `/api/me` started looking very fast.

How do you cache a page that depends on the user?

The strongest answer

`Cache-Control: private` (or no-store) for personalised HTML/JSON, and if you cache at the edge, key on a signed cache identity — never cache `Authorization` or cookie-varying responses as `public` without Vary you actually honour

Why it works

Exactly. Caching personalised JSON at the edge is how Alice sees Bob's invoice. Private/no-store is the default; shared cache needs an explicit, tested key.

What a good answer covers

Answers that fall short

Who gets asked this

More System Design Basics questions