Pick the fix
GET /me returns the signed-in user's profile. Which header is right?
Hint 1 of 1
Who may store a personal response?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Cache-Control: private, max-age=0, must-revalidate with an ETag
Correct. Only the browser keeps it, and it revalidates each time.
private keeps shared caches like CDNs from storing one user's data. max-age=0 with must-revalidate makes the browser ask every time, and the ETag lets the server answer 304 when nothing changed.
Why not the others?
- B
Cache-Control: public, max-age=300. A CDN could serve one user's profile to another. - C
Cache-Control: s-maxage=300. Lets shared caches store personal data. - D
Cache-Control: immutable. Profiles change.