Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

If no private nor public were defined in the cache-control, e.g.

 Cache-Control: max-age=31461276

What is the expected behavior?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

It seem it tells browser that the cache expires after 1 year, 31461276 seconds means 1 year.

More details in this post: EXPIRES VS. MAX-AGE

share|improve this answer
    
I know what is expires and max-age, but just don't know what are the different if I missed the public –  Yoga Nov 23 '12 at 18:12
    
@Yoga I guess it behaves as public unless you have HTTP authentication. –  Eduard Florinescu Nov 23 '12 at 18:22
    
This made sense. –  Yoga Nov 24 '12 at 6:12
add comment

See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3:

The max-age directive on a response implies that the response is cacheable
(i.e., "public") unless some other, more restrictive cache directive is 
also present.

It's conceivable (likely?) that there are proxies in the wild which break this but since the only failure mode could be treating a public resource as private the consequences should be minimal beyond a modest performance hit. You'll have far more problems with proxies which do things like cache resources far beyond your specified max-age.

share|improve this answer
1  
@Yoga You should accept this answer –  mgutt Mar 7 '13 at 14:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.