Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 14389 invoked from network); 27 Mar 2007 11:16:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2007 11:16:04 -0000 Received: (qmail 1387 invoked by uid 500); 27 Mar 2007 11:16:09 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 1294 invoked by uid 500); 27 Mar 2007 11:16:09 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 1283 invoked by uid 99); 27 Mar 2007 11:16:09 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 04:16:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [213.133.33.40] (HELO smtp.is.nl) (213.133.33.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 04:16:00 -0700 Received: from [213.133.51.241] (HELO hai01.hippo.local) by smtp.is.nl (CommuniGate Pro SMTP 5.0.10) with ESMTP id 12596522 for dev@cocoon.apache.org; Tue, 27 Mar 2007 13:15:45 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Moving reduced version of CachingSource to core | Configuration issues Date: Tue, 27 Mar 2007 13:15:19 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Moving reduced version of CachingSource to core | Configuration issues Thread-Index: AcdwYB1JH+Z9shxcTGC+yk6w4DA4pgAAGd3g From: "Ard Schrijvers" To: X-Virus-Checked: Checked by ClamAV on apache.org >=20 > This if statement checks if a parameter starts with=20 > "cocoon:cache" and if yes,=20 > it add it to the params object and removes it from the=20 > "normal" request=20 > parameters. It looks fine for me and the expires value is set=20 > correctly at the=20 > source AFAICS. BTW, I'm working on trunk. Yes I saw this about the cocoon:cache, but it seems to me that the other = parameters are forgotten to add to params, and therefor, int expires =3D = params.getParameterAsInteger(CachingSource.CACHE_EXPIRES_PARAM, = defaultExpires); always returns a -1...Look at the code snipper below = from the getSource in the trunk: index =3D uri.indexOf('?'); if (index !=3D -1) { sp =3D new SourceParameters(uri.substring(index + 1)); uri =3D uri.substring(0, index); } // put caching source specific query string parameters // into a Parameters object final Parameters params =3D new Parameters(); if (sp !=3D null) { SourceParameters remainingParameters =3D (SourceParameters) = sp.clone(); final Iterator names =3D sp.getParameterNames(); while (names.hasNext()) { String name =3D (String) names.next(); if (name.startsWith("cocoon:cache")) { = params.setParameter(name.substring("cocoon:".length()), = sp.getParameter(name)); remainingParameters.removeParameter(name); } } String queryString =3D = remainingParameters.getEncodedQueryString(); if (queryString !=3D null) { uri +=3D "?" + queryString; } } int expires =3D = params.getParameterAsInteger(CachingSource.CACHE_EXPIRES_PARAM, = defaultExpires); =20 The only parameter that is added to params is the cocoon:cache, and = therefor expires always has the defaultExpires. if (name.startsWith("cocoon:cache")) { = params.setParameter(name.substring("cocoon:".length()), = sp.getParameter(name)); remainingParameters.removeParameter(name); } else{ params.setParameter(name,sp.getParameter(name)); } solves this IMO Ard =20 >=20 >=20 > > because all parameters are neglected in the current way.=20 > >=20 > > Then, when I do have my expires accounted for correctly, I=20 > do not understand why while the cached object is not expired,=20 > there is still a call for the remote source. This doesn't=20 > make sense to me. Also, when the expires is set correctly,=20 > and the object is expired, I am getting a=20 > NullPointerException, but it might be because we use an old=20 > version...? >=20 > I can confirm this but don't know where those requests come=20 > from. I could be=20 > caused by a validity check but that's only a wild guess. >=20 > --=20 > Reinhard P=F6tz Independent Consultant, Trainer & (IT)-Coach = >=20 > {Software Engineering, Open Source, Web Applications, Apache Cocoon} >=20 > web(log): http://www.poetz.cc > -------------------------------------------------------------------- >=20