Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 76613 invoked by uid 500); 29 Oct 2002 00:26:51 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 76602 invoked from network); 29 Oct 2002 00:26:50 -0000 Message-ID: <3DBDD5A3.4000007@verizon.net> Date: Mon, 28 Oct 2002 19:26:11 -0500 From: Vadim Gritsenko User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: CaheValidity & toString() References: <06F21F6856B6BF4FADEBF2C3BC2D99233C7527@genoa.lumigent.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH PLAIN at pop015.verizon.net from [141.156.160.227] at Mon, 28 Oct 2002 18:26:52 -0600 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Stephen Ng wrote: >>... which means that these two URLs produce different >>Validity objects >>in from-an-xsp pipeline. Is it right? >>But what about validity? Seems that it changes. >> >> >> > >Yes the validity changes, but ContentAggregator's key is the same. > Yes, of course. > If >two objects have the same Key, it looks like only the second one > It's not second one, it's *the* *same* object. Equal keys == same object. See cacheable.xsp to get an idea, it shows how with the help of a single XSP you can create multiple objects (with different keys). In cacheable.xsp, every different value of the request parameter 'param' will create different object (in the cache). > is >stored/retrieved from the cache. > > > >>Right now it has: >> key += HashUtil.hash("P=" + >> part.stripRootElement + ':' + >> current.getSystemId() + ';'); >> >>And that is correct. >> >> >> > >Yes, I mean to add my change *after* the other lines, so that >getLastModified is part of the key. Here is the whole section: > > if (current.getLastModified() == 0) { > return 0; > } else { > if (part.element == null) { > key += HashUtil.hash("P=" + > part.stripRootElement + ':' + > current.getSystemId() + ';'); > } else { > key += HashUtil.hash("P=" + > part.element.prefix + > ':' + > part.element.name + > '<' + part.element.namespace + >">:" + > part.stripRootElement + ':' + > current.getSystemId() + ';'); > } > key += current.getLastModified(); // <-- ADD THIS >LINE > } > >If this still doesn't make sense, I will take a moment to try to >reproduce this in the standard 2.0.3 distribution.... > I think you had confusion here. Main point is: Key identfies object, Validity represents *status* of this object (changed - need to be re-generated / not changed - can serve from cache). Thus, to create several objects, simply generate different keys. Vadim >Steve > > --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org