Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 34816 invoked from network); 17 Apr 2007 11:29:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Apr 2007 11:29:28 -0000 Received: (qmail 26762 invoked by uid 500); 17 Apr 2007 11:29:29 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 26701 invoked by uid 500); 17 Apr 2007 11:29:29 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 26685 invoked by uid 99); 17 Apr 2007 11:29:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2007 04:29:29 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=INFO_TLD 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, 17 Apr 2007 04:29:21 -0700 Received: from [213.133.51.241] (HELO hai01.hippo.local) by smtp.is.nl (CommuniGate Pro SMTP 5.0.10) with ESMTP id 13804166 for users@cocoon.apache.org; Tue, 17 Apr 2007 13:28:59 +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: Cache (persistence & performance) Date: Tue, 17 Apr 2007 13:28:59 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Cache (persistence & performance) Thread-Index: AceA1IWLtx2A4MAwQQuGPSX8RYVeswADmqQw From: "Ard Schrijvers" To: X-Virus-Checked: Checked by ClamAV on apache.org > Thank you for your reply, Ard! >=20 > I don't know how to control the cache from cocoon.xconf. I use Cocoon=20 > 2.1.7. The cache section in cocoon.xconf looks like this: >=20 > > > > =20 > > > >=20 > I see two files being modified after some "action" using the webapp:=20 > cocoon-ehcache-1.data & cocoon-ehcache-1.index. I asume > that this is the persistent cache.=20 It is a cache that uses disk. It is only diskpersistent when you = configure it to be. The transient store is a memory only store, because = it has non serializable cached objects. The second store is you configuration for the ehcache. You can add: but it might be very well possible that this is added after cocoon 2.1.7 = , so you would need to update. Chech the EHDefaultStore.java to see which parameters are allowed, or = check the wiki (dont know if is up2date) and look for "caching", = "ehcache", "ard schrijvers" etc in=20 http://marc.info/?l=3Dxml-cocoon-users&r=3D1&w=3D2 i have posted many explanations on cocoon caching before, Regards Ard > Am I right? If so, why=20 > doesn't Cocoon=20 > use this cache after a webserver restart? I put System.out.println > statements in my generators and they confirm that the content=20 > is being=20 > regenerated (content is cached correctly while the webserver=20 > is running). > It's like a transient cache is working correctly, but a=20 > persistent cache=20 > is not. >=20 > Where can I find the parameters that I can use with these 2 stores? > As you said, I want cache that is persistent between JVM=20 > restarts. Can I=20 > get a step further and copy the persistent cache > to another installation of my webapp (onto another webserver)? >=20 > I'm sure that I do not have all the information needed about this=20 > matter. Can you please provide some good links ? I only > found bits and pieces here and there all around the web=20 > (weird sentence:). >=20 > Thanks a lot! >=20 > Dan >=20 > Ard Schrijvers wrote: > > Hello Dan, > > > > =20 > >> Hi! > >> > >> I have been trying for a few days now to find out where (and=20 > >> if) Cocoon persists > >> the cached XML chunks obtained from pipelines. Almost all of=20 > >> the pipelines I've > >> written implement CacheableProccessingComponent.=20 > >> =20 > > > > You mean all your compoments in a pipeline implement=20 > CacheableProccessingComponent. If one does not, > > your cocoon caches untill the first not cacheable=20 > transformer (if the generator does not cache, > > nothing gets cached. Also, implementing=20 > CacheableProccessingComponent is no garantuee for a proper working > > cache of your component. The cachekey and validity object=20 > do have to make sense! [1] ) > > > > =20 > >> I read=20 > >> something about a > >> tag in cocoon.xconf, but I didn't=20 > >> understand much.=20 > >> =20 > > > > A persistent-store...just to be sure, means that you want a=20 > cache that is persistent between JVM restarts, right? If you=20 > are using EHCache,=20 > > you can see in this code snippet where it stores the cached=20 > responses (if you use EHCache): > > > > try { > > if=20 > (parameters.getParameterAsBoolean("use-cache-directory", false)) { > > if (this.getLogger().isDebugEnabled()) { > > getLogger().debug("Using cache=20 > directory: " + cacheDir); > > } > > setDirectory(cacheDir); > > } > > else if=20 > (parameters.getParameterAsBoolean("use-work-directory", false)) { > > if (this.getLogger().isDebugEnabled()) { > > getLogger().debug("Using work=20 > directory: " + workDir); > > } > > setDirectory(workDir); > > } > > else if (parameters.getParameter("directory",=20 > null) !=3D null) { > > String dir =3D parameters.getParameter("directory"); > > dir =3D=20 > IOUtils.getContextFilePath(workDir.getPath(), dir); > > if (this.getLogger().isDebugEnabled()) { > > getLogger().debug("Using directory: " + dir); > > } > > setDirectory(new File(dir)); > > } > > else { > > try { > > // Legacy: use working directory by default > > setDirectory(workDir); > > } catch (IOException e) { > > } > > } > > } catch (IOException e) { > > throw new ParameterException("Unable to set=20 > directory", e); > > } > > > > in cocoon.xconf, you can set in the ehcache store=20 > configuration, > > > > > > =20 > >> Can you > >> please tell me how, or at least where is Cocoon persisting=20 > >> its cache and is > >> there a way to redirect this persistence (say to a DB)? > >> =20 > > > > To a DB....I would use a Cache which is capable of=20 > persisting in a DB (JCS can, I suppose EHCache also) > > > > =20 > >> And another thing... Can you please tell me what parameters=20 > >> do I need to modify > >> in order to temper with Cocoon's cache performance. > >> =20 > > > > ?? what do you mean? Anyway, the cache parameters are in=20 > cocoon.xconf in . You can find this on the wiki > > > > =20 > >> P.S. By Cocoon's cache, I understand cached versions of a XML=20 > >> generated > >> response. Is this correct? Maybe I got it all wrong... > >> =20 > > > > Hmmm, more or less you could see it that way (though it is=20 > more subtle, look at CachedResponse if you want to know=20 > more...also look at your=20 > > localhost:port/status page to see which cachekeys are created) > > > > =20 > >> Many thanks! > >> =20 > > > > Regards Ard > > > > [1] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g7/690.html > > > > =20 > >> Dan > >> > >> ---------------------------------------------------------------- > >> This message was sent using IMP, the Internet Messaging Program. > >> > >> > >> > >>=20 > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > >> For additional commands, e-mail: users-help@cocoon.apache.org > >> > >> > >> =20 > > > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > > For additional commands, e-mail: users-help@cocoon.apache.org > > > > > > > > =20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org