Practical Usage


Cocoon is a vast system, which makes it hard to learn what it offers and how to use it. One of the best resources for Cocoon help is the Cocoon Wiki at http://wiki.cocoondev.org. This Wiki has more documentation than the regular Cocoon documentation set, and, most important, it has a search engine. There are tutorials, how-to documents, collections of Cocoon best practices, and more.

Performance

There are some important things you should know about Cocoon performance:

  • The logging has a big impact on performance, so you should turn off as much of it as possible.

  • The sizing of the various Cocoon pools makes a big difference in performance. You can tune pool sizes in your sitemap file and in cocoon.xconf.

  • If you have static content mixed in with your dynamic content, consider using Apache to relieve Cocoon of the burden of serving static content.

  • Be careful about the performance of your XSLT stylesheets if you’re using a lot of them. Here are a couple of things you can do:

    • Keep stylesheets small, with a small number of templates. From this point of view, it’s better to have more little stylesheets rather than fewer large stylesheets.

    • Consider using Xalan’s XSLTC compiled mode.

  • XSPs can be slow if they’re being recompiled. Cocoon compiles XSPs into Java files. You can create generators that use those compiled classes instead of recompiling them. These files are located in the directory where your servlet engine compiles pages (including JSPs), in the path org/apache/cocoon/www/<name of XSP>.class. You can create a generator from the compiled class by using <map:generator type="compiledXSP" src="/books/2/639/1/html/2/org.apache.cocoon.www.<name of XSP>.class/>. You then use the generator normally via <map:generate type="compiledXSP"/>.

  • Use the Cocoon profiler to tell you how much time is being spent in the SAX event pipeline.




Professional XML Development with Apache Tools. Xerces, Xalan, FOP, Cocoon, Axis, Xindice
Professional XML Development with Apache Tools: Xerces, Xalan, FOP, Cocoon, Axis, Xindice (Wrox Professional Guides)
ISBN: 0764543555
EAN: 2147483647
Year: 2003
Pages: 95

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net