Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 1099 invoked from network); 8 Feb 2008 03:29:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2008 03:29:31 -0000 Received: (qmail 84739 invoked by uid 500); 8 Feb 2008 03:29:22 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 84655 invoked by uid 500); 8 Feb 2008 03:29:22 -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 84642 invoked by uid 99); 8 Feb 2008 03:29:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2008 19:29:22 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 03:29:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 453FB71407A for ; Thu, 7 Feb 2008 19:29:09 -0800 (PST) Message-ID: <11806565.1202441349251.JavaMail.jira@brutus> Date: Thu, 7 Feb 2008 19:29:09 -0800 (PST) From: "Vadim Gritsenko (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON-2166) Enable caching of IncludeTransformer if not all includes could be resolved In-Reply-To: <27769563.1202422508911.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON-2166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566900#action_12566900 ] Vadim Gritsenko commented on COCOON-2166: ----------------------------------------- You should differentiate the case when source exists but not cacheable, and when source does not exist. Otherwise you will be caching what must not be cached. > Enable caching of IncludeTransformer if not all includes could be resolved > -------------------------------------------------------------------------- > > Key: COCOON-2166 > URL: https://issues.apache.org/jira/browse/COCOON-2166 > Project: Cocoon > Issue Type: Improvement > Components: * Cocoon Core > Affects Versions: 2.1.12-dev (Current SVN) > Reporter: Andreas Hartmann > Attachments: patch-issue2166.txt > > > About the context: In Lenya, we have a couple of modules, which are basically directories. A module directory can include an optional menu.xml file. The Lenya GUI menubar is an aggregation of all these menu.xml files, with some postprocessing. The same mechanism is used for the i18n catalogue - modules can provide i18n catalogues for their GUIs. > We use the IncludeTransformer to assemble the menu XML, ignoring the non-existing menus using . It looks basically like this: > > > > > > This is extremely fast if all modules contain menu.xml files, because the aggregated XML is cached. But if some of the includes can't be resolved, nothing is cached. This causes up to 50% more request processing time, so it has quite a big impact on the Lenya GUI performance :) > I tracked the source of the behaviour down to the MultiSourceValidity class. As soon as one of the sources has no validity (IIUC this happens if a FileSource doesn't exist), the whole MultiSourceValidity becomes invalid: > public void addSource(Source src) { > if (this.uris != null) { > SourceValidity validity = src.getValidity(); > if (validity == null) { > /* The source has no validity: this will be > always be invalid. */ > this.uris = null; > From my POV it would be better to ignore the non-existing sources, and check their existence when the validity is computed the next time. I.e. MultiSourceValidity.isValid() would return UNKNOWN, and isValid(newValidity) -> computeStatus() would check if newValidity provides a validity for the formerly missing source. > Do you think this behaviour would be reasonable? If yes, I'd try to implement it, preferrably with test cases to avoid regressions. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.