Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 92526 invoked from network); 10 Dec 2003 14:49:31 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 10 Dec 2003 14:49:31 -0000 Received: (qmail 16802 invoked by uid 500); 10 Dec 2003 14:49:21 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 16755 invoked by uid 500); 10 Dec 2003 14:49:21 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 16740 invoked from network); 10 Dec 2003 14:49:21 -0000 Received: from unknown (HELO Boron.MeepZor.Com) (204.146.167.214) by daedalus.apache.org with SMTP; 10 Dec 2003 14:49:21 -0000 Received: from remulak.net (rdu74-183-113.nc.rr.com [24.74.183.113]) by Boron.MeepZor.Com (8.11.6/8.11.6) with ESMTP id hBAEnNs29938 for ; Wed, 10 Dec 2003 09:49:23 -0500 Message-ID: <3FD73037.8070203@remulak.net> Date: Wed, 10 Dec 2003 09:39:51 -0500 From: "Paul J. Reder" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: mod_cache not sending "If-Modified-Since" headers References: <45D4FFF3A2E8D41196FF0000F6FFF41B0538454D@gsys-s01.generali.fr> In-Reply-To: <45D4FFF3A2E8D41196FF0000F6FFF41B0538454D@gsys-s01.generali.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thomas, Sorry for the delay, other work ended up calling me away. This is still on my work list. I'm hoping to get back into it this week. I do have a couple of concerns with the patch as it currently exists. Things like looking for Etag and Last-Modified in only one of the *headers_out locations. I have to finish a piece of high priority work up today and tomorrow and then, hopefully, I can get back to this. Paul J. Reder CASTELLE Thomas wrote: > Hello everyone, > > I reported a few months ago a problem concerning mod_cache not sending a > "If-Modified-Since" when the cache is staled (see the end of my e-mail > below). At that time I proposed a patch against 2.0.47 but Paul J. Reder > answered me it was a mod_disk_cache problem and that it will be solved > later. But it's not in the 2.0.48 release. > > Does someone has any news about it ? > > For your information, I join to this e-mail the patch I wrote against > 2.0.47. > > Thanks in advance for your answer. > > Thomas. > > > > -----Message d'origine----- > *De :* CASTELLE Thomas [mailto:tcastelle@generali.fr] > *Envoy� :* jeudi 12 juin 2003 17:49 > *� :* dev@httpd.apache.org > *Objet :* [PATCH] mod_cache RFC compliance > > Hello, > > In order to accelerate the RFC compliance of mod_cache, I propose > these two patches which fix two problems : > - It doesn't handle the Cache-Control directives (max-age, > max-stale, min-fresh...) properly. > - It doesn't send a "If-Modified-Since" to avoid that the backend > server sends every time a 200 response where a 304 would be enough. > > Actually, we are waiting for these features to be implemented since > http-2.0.43 so that we could put Apache in our production > environment. I am not an Apache developper, so this is just a > proposition, but I tested it and it seemed to work. > > > The cache_util.c patch deals with the first issue. First, the > Cache-Control directive seems to be in the r->err_headers_out and > not in the r->headers_out. Second, the following test seems useless : > > if ((-1 < smaxage && age < (smaxage - minfresh)) || > (-1 < maxage && age < (maxage + maxstale - minfresh)) || > (info->expire != APR_DATE_BAD && > age < (apr_time_sec(info->expire - info->date) + maxstale > - minfresh))) { > > because it is always true, no matter if max-age is set or not. > Let's take an example (I suppose here s-maxage, max-stale and > min-fresh not set, > so smaxage = - 1, maxstale = 0 and minfresh = 0) : > - with age = 20, maxage = -1 (not set) and expire - date = 30, the > second test > is FALSE. The third is TRUE. So the whole test is TRUE, the page is > considered > to be fresh => no problem. > - with age = 20, maxage = 10 and expire - date = 30, the second test > is FALSE, > but the third is still TRUE. So the whole test is TRUE, the page is > considered > to be fresh => problem. > > > The mod_cache.c patch deals with the second issue. The info > structure is never initialized, and even if it was, the > info->lastmods and info->etag don't seem to be saved in the file > when using mod_disk_cache. So I used the Etag and Last-Modified > informations we can find in the r->headers_out and > r->err_headers_out. I don't know if it's correct, but it seems to > work now... > > Thanks for looking to these patch and eventually integrate it in the > next Apache release ! > > Thanks a lot for this really great product ! > > > Thomas. > > -- Paul J. Reder ----------------------------------------------------------- "The strength of the Constitution lies entirely in the determination of each citizen to defend it. Only if every single citizen feels duty bound to do his share in this defense are the constitutional rights secure." -- Albert Einstein