On mån, 2008-06-09 at 02:46 +0800, howard chen wrote: > Hi > > Thank you very much, after played around for sometime, concept about > caching are much clear now! > > > On Fri, Jun 6, 2008 at 4:00 AM, Henrik Nordstrom > <henrik@xxxxxxxxxxxxxxxxxxx> wrote: > > > > There is a default refresh_pattern in the code, equal to > > refresh_pattern . 0 20% 4320 > > > > 1. Isn't this violating the standard (assuming the absence of squid as > reverse proxy)? > > http://www.mozilla.org/projects/netlib/http/http-caching-faq.html > > expirationTime = responseTime + freshnessLifetime - currentAge > > RFC 2616: If only LM can be used, freshness = value of the "Date" > header minus the value of the "Last-modified" header divided by 10... Squid is using divided by 5. RFC2616 says this regarding heuristic expiration time: heuristic expiration time An expiration time assigned by a cache when no explicit expiration time is available. Since origin servers do not always provide explicit expiration times, HTTP caches typically assign heuristic expiration times, employing algorithms that use other header values (such as the Last-Modified time) to estimate a plausible expiration time. The HTTP/1.1 specification does not provide specific algorithms, but does impose worst-case constraints on their results. Since heuristic expiration times might compromise semantic transparency, they ought to used cautiously, and we encourage origin servers to provide explicit expiration times as much as possible. If none of Expires, Cache-Control: max-age, or Cache-Control: s- maxage (see section 14.9.3) appears in the response, and the response does not include other restrictions on caching, the cache MAY compute a freshness lifetime using a heuristic. The cache MUST attach Warning 113 to any response whose age is more than 24 hours if such warning has not already been added. Also, if the response does have a Last-Modified time, the heuristic expiration value SHOULD be no more than some fraction of the interval since that time. A typical setting of this fraction might be 10%. [copy-pasted from several sections] > 2. Another interesting behavior I have tested is Squid will only store > cache if expire > 60, where this value can be set? See minimum_expiry_time. Note: this cache limit is only on objects without an usable cache validator such as ETag or Last-Modified. Objects with a cache validator is always cached unless forbidden. Regards Henrik