Reputation: 3233
I was trying to figure out the best cache headers for my site and couldn't find a good resource about setting both max-age
and public
.
In my situation I have a number of files where I am not worried about them expiring, if I were to set max-age it would probably be a month or year. But my question is, should the max-age
be omitted, and just specify Cache-Control: public
? Isn't that essentially saying "cache for as long as you can"?
TL;DR Are there any advantages/disadvantages to setting max-age
if public
is set and the objects have an indefinite expiry time?
Upvotes: 0
Views: 448
Reputation: 6660
Cache-Control: public
means that the resource is publicly available, and thus may be put in cache available to several users (such as a corporate Internet proxy). It has nothing to do with how long a resource may be cached. See RFC2616.
Upvotes: 1