Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 95550 invoked from network); 2 May 2006 10:02:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 May 2006 10:02:06 -0000 Received: (qmail 34010 invoked by uid 500); 2 May 2006 10:01:54 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 33942 invoked by uid 500); 2 May 2006 10:01:54 -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: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 33931 invoked by uid 99); 2 May 2006 10:01:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2006 03:01:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of minfrin@sharp.fm designates 64.49.220.200 as permitted sender) Received: from [64.49.220.200] (HELO chandler.sharp.fm) (64.49.220.200) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 May 2006 03:01:52 -0700 Received: from chandler.sharp.fm (localhost [127.0.0.1]) by chandler.sharp.fm (Postfix) with ESMTP id E2D51E54ED for ; Tue, 2 May 2006 05:01:31 -0500 (CDT) Received: from www.sharp.fm (unknown [209.61.173.189]) by chandler.sharp.fm (Postfix) with ESMTP id A610EE4396; Tue, 2 May 2006 05:01:31 -0500 (CDT) Received: from 196.8.104.37 (SquirrelMail authenticated user minfrin@sharp.fm); by www.sharp.fm with HTTP; Tue, 2 May 2006 12:01:31 +0200 (SAST) Message-ID: <38271.196.8.104.37.1146564091.squirrel@www.sharp.fm> In-Reply-To: References: <4450CF63.2060305@turner.com> <445136CC.6030305@sharp.fm><44520B45.6070507@turner.com> <4455203F.9000509@sharp.fm> <44560316.3030705@turner.com><445664B1.5030905@sharp.fm> <445665B2.3010604@turner.com><20060501171853.8fd9164a.davi@haxent.com.br> Date: Tue, 2 May 2006 12:01:31 +0200 (SAST) Subject: Re: Possible new cache architecture From: "Graham Leggett" To: dev@httpd.apache.org Cc: dev@httpd.apache.org User-Agent: SquirrelMail/1.4.3a-12.EL4 X-Mailer: SquirrelMail/1.4.3a-12.EL4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tue, May 2, 2006 11:22 am, Niklas Edmundsson said: > I've been hacking on mod_disk_cache to make it: > * Only store one set of data when one uncached item is accessed > simultaneously (currently all requests cache the file and the last > finished cache process is "wins"). > * Don't wait until the whole item is cached, reply while caching > (currently it stalls). > * Don't block the requesting thread when requestng a large uncached > item, cache in the background and reply while caching (currently it > stalls). This is great, in doing this you've been solving a proxy bug that was first reported in 1998 :). The only things to be careful of is for Cache-Control: no-cache and friends to be handled gracefully (the partially cached file should be marked as "delete-me" so that the current request creates a new cache file / no cache file. Existing running downloads should be unaffected by this.), and for backend failures (either a timeout or a premature socket close) to cause the cache entry to be invalidated and deleted. > * More or less atomic operations, so caching headers and data in > separate files gets very messy if you want to keep consistency. Keep in mind that HTTP/1.1 compliance requires that the headers be updatable without changing the body. > * You can't use tempfiles since you want to be able to figure out > where the data is to be able to reply while caching. > * You want to know the size of the data in order to tell when you're > done (ie the current size of a file isn't necessarily the real size > of the body since it might be caching while we're reading it). The cache already wants to know the size of the data so that it can decide whether it's prepared to try and cache the file in the first place, so in theory this should not be a problem. > In any case the patch is more or less finished, independent testing > and auditing haven't been done yet but I can submit a preliminary > jumbo-patch if people are interested in having a look at it now. Post it, people can take a look. Regards, Graham --