AW: [opencms-dev] Caching in the Navigation class

Oliver Faulhaber ofh3 at hotmail.com
Fri Oct 19 12:04:23 CEST 2001


Dear Andreas,

that works fine!

Because we have inherited our navigation class from CmsXmlNav, this Method 
has been already used, during the performance tests, we called each URL only 
one time after a restart.
;)
Thanks a lot,
Oliver


>From: Andreas Schouten <Andreas.Schouten at framfab.de>
>Reply-To: opencms-dev at www.opencms.com
>To: "'opencms-dev at www.opencms.com'" <opencms-dev at www.opencms.com>
>Subject: AW: [opencms-dev] Caching in the Navigation class
>Date: Fri, 19 Oct 2001 11:38:54 +0200
>
>Hi,
>
>you can use the element and variant cache for your probelm. Add the
>following lines to your navigation class:
>
>     /**
>      * gets the caching information from the current template class.
>      *
>      * @param cms CmsObject Object for accessing system resources
>      * @param templateFile Filename of the template file
>      * @param elementName Element name of this template in our parent
>template.
>      * @param parameters Hashtable with all template class parameters.
>      * @param templateSelector template section that should be processed.
>      * @return <EM>true</EM> if this class may stream it's results,
><EM>false</EM> otherwise.
>      */
>     public CmsCacheDirectives getCacheDirectives(CmsObject cms, String
>templateFile, String elementName, Hashtable parameters, String
>templateSelector) {
>
>         // First build our own cache directives.
>         CmsCacheDirectives result = new CmsCacheDirectives(true);
>         result.setCacheUri(true);
>         result.renewAfterEveryPublish();
>         return result;
>     }
>
>Now the output of your class should be cached. You can see this as an
>example in com.opencms.defaults.CmsXmlNav
>
>Regards,
>Andreas
>
>-----Ursprüngliche Nachricht-----
>Von: Oliver Faulhaber [mailto:ofh3 at hotmail.com]
>Gesendet: Freitag, 19. Oktober 2001 11:19
>An: opencms-dev at opencms.com
>Betreff: [opencms-dev] Caching in the Navigation class
>
>
>Hi OpenCms-Developers
>
>at the moment we work on a OpenCms project with a complex HTML Frontend.
>
>By requesting a page within this project, the method getNavFold() is
>executed five times in our navigation class (due to the HTML structure of a
>page)
>
>The method getNavFold() uses, among other things, the method
>getSubFolders(String folder) of the class CmsObject, which needs 25-50
>milliseconds for its execution on our systems.
>
>Since, as already mentioned, our pages produce above 5 calls of
>getSubFolders(), we get response times within up to 300 milliseconds, which
>naturally represents a very long response time.
>
>Therefore I have taken a look into the OpenCms-classes an have found, in
>getSubFolders(...) in the genericSQL-RessourceBroker, the following 
>comment:
>
>    // Todo: add caching for getSubFolders
>    //
>folders=(Vector)m_subresCache.get(C_FOLDER+currentProject.getId()+foldername
>);
>
>;)
>
>we would be very glad, if in one of the next releases this caching were
>implemented. This would accelerate our project dramatically.
>
>Thank you and many greetings
>Oliver Faulhaber
>
>_________________________________________________________________
>Downloaden Sie MSN Explorer kostenlos unter http://explorer.msn.de/intl.asp


_________________________________________________________________
Downloaden Sie MSN Explorer kostenlos unter http://explorer.msn.de/intl.asp




More information about the opencms-dev mailing list