[opencms-dev] Re: Re: need help: how improving opencms performance?

Christian Steinert christian_steinert at web.de
Wed Jan 31 00:09:01 CET 2007


andrea cossu schrieb:
> We are using the default settings.
> Where can i set the flex-cache behavior?
>
> Andrea
>
>   
Opencms needs some help, because only you can know which parts of a web
page are allowed to be cached and which parts have to be re-generated
for each user.

Even if caching is enabled, you have to actively tell opencms, which
resources should be cached, [I don't know if complete pages are cached
by default, but page elements are definitely not cached without you
doing something for it]. There is a property called "cache" and this
property has to be set for your template files. Since opencms cannot
know which parts of a page should always be freshly generated and which
parts can be cached and how they can and cannot be re-used, you have to
set the "cache" property for your JSP fikles.

I use the following approach:

1. - For my complete templates, the cache property is set to "uri". This
means that completely assembled  pages are cached. I can safely do this,
because my site is not personalized.
2. - My templates include code from other JSP files. These other JSPs
will create re-usable blocks, like the navigation header and
left-side-navigation. For these JSPs, the cache property is set to
"locale;element":
--> "element, because my JSPs contain more than one opencms template
element, so each element of course has to be cached separately
[otherwise if the header element is called, then the cached output of
the header element would also be used, if the side element form the same
file is needed, so we need to cache each element individually, as soon
as a file has more than one element]
--> "locale": my site is multilingual, so the navigation will only be
the same for all pages of the *same* language. Therefore, content has to
be generated and cached independently for each locale
3. - A few of my JSP include files also use cache="element". This is for
elements that are not language-specific (e.g. Javascript code that is
always included)


Element caching is really quite powerful, because with it, all re-usable
blocks have to be generated only once for the complete website and then
they can be re-used on all pages. The values of the cache property are
described in the Alkacon documentation. You can use many other options
to control caching behavior (e.g. specify individual timeouts for the
content generated by a given JSP, force opencms to create different
cache versions based on URL parameters and so on).

The cache Administration in the opencms workplace shows you, which pages
and page elements are currently contained in your cache. This should
help to check if your cache is actually used and if pages, page elements
and variants of page elements are actually cached as intended.


hth
christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070131/a5c866bc/attachment.bin>


More information about the opencms-dev mailing list