users@jersey.java.net

Proposal: Don't include "public" in CacheConrol if .setMaxAge(int) was called.

From: Markus KARG <markus.karg_at_gmx.net>
Date: Sun, 27 Jul 2008 19:33:08 +0200

I just noticed that CacheControl by default contains the tag "public",
which is not wrong (even it is not told in the apidocs: apidocs only say
that the tag "private" is NOT included), but: HTTP/1.1 says "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.". So, actually when doing .setMaxAge(int) then there is no more
need to include "public". For optimal speed, I would propose that as
soon as .setMaxAge(int) was called, then no more "public" tag shall be
contained in the Cache-Control header. Effectively, "public" is just a
replacement for "max-age: 0", so it makes no sense to have both tags in
the same Cache-Control header. This would reduce the number of used tags
(what always is good and what I think is the idea of the implied
"public" in the HTTP/1.1 spec) and will be 100% compliant to HTTP/1.1. :-)

Have Fun
Markus

-- 
http://www.xing.com/go/invita/58469