On 05/17/2007 08:25 PM, [EMAIL PROTECTED] wrote: > Author: jerenkrantz > Date: Thu May 17 11:25:13 2007 > New Revision: 539063
> Modified: httpd/httpd/trunk/modules/cache/mod_cache.c > URL: > http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache.c?view=diff&rev=539063&r1=539062&r2=539063 > ============================================================================== > --- httpd/httpd/trunk/modules/cache/mod_cache.c (original) > +++ httpd/httpd/trunk/modules/cache/mod_cache.c Thu May 17 11:25:13 2007 > @@ -701,19 +701,42 @@ > } > > /* if no expiry date then > - * if lastmod > + * if Cache-Control: max-age > + * expiry date = date + max-age > + * else if lastmod > * expiry date = date + min((date - lastmod) * factor, maxexpire) > * else > * expire date = date + defaultexpire > */ > if (exp == APR_DATE_BAD) { > char expire_hdr[APR_RFC822_DATE_LEN]; > + char *max_age_val; > > - /* if lastmod == date then you get 0*conf->factor which results in > - * an expiration time of now. This causes some problems with > - * freshness calculations, so we choose the else path... > - */ > - if ((lastmod != APR_DATE_BAD) && (lastmod < date)) { > + if (ap_cache_liststr(r->pool, cc_out, "max-age", &max_age_val) && > + max_age_val != NULL) { > + apr_int64_t x; > + > + errno = 0; > + x = apr_atoi64(max_age_val); > + if (errno) { > + x = conf->defex; Hm. Shouldn't we adjust the bogus max-age field value in the Cache-Control header in r->headers_out / r->err_headers_out to conf->defex (in seconds of course) in this case? Regards RĂ¼diger