Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cache-control: private and public

What should a http client do if server returned Cache-Control: private, public ?

I have a feeling private should override public, but I can't find a confirmation in the RFC (other than MUST in private and MAY in public).

like image 578
Andrey Shchekin Avatar asked Feb 26 '23 03:02

Andrey Shchekin


2 Answers

I believe http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p6-cache-20.html#rfc.section.3 is pretty clear -- if it's labeled "private" it needs to be considered private, no matter whether "public" appears as well

like image 167
Julian Reschke Avatar answered Mar 16 '23 08:03

Julian Reschke


From a pragmatic point of view, err on the side of caution and treat it "private".

That way you cause a little extra network traffic for the lousy server, but keep your user's (potentially private) data safe.

like image 33
Szocske Avatar answered Mar 16 '23 08:03

Szocske