[opencms-dev] FLEX CACHE
Christian Steinert
christian_steinert at web.de
Sat May 9 05:06:21 CEST 2009
One more addition:
Rüdiger listed the different directives which you can put into the
"cache" property in the file system.
These settings can also be combined. For example, if you set the cache
property to "locale;element" then the flex cache will generate a
separate cached version of each template-element in your JSP for each
locale.
The cache property can be set for normal resources (like pages) to cache
complete pages or it can be set for JSP templates. The latter allows you
to cache the output of a JSP without re-generating that output whenever
that JSP is included into another template which is quite powerful.
The output of your JSP would be cached separately for each permutation
of included template-element and each different locale. For example, if
you have two locales on your website and a JSP with three template
elements in it, then this would result in a maximum of six different
cache variants for this JSP and thes correct one of these variants would
automatically be included into your including page, as needed.
Also, if you have a page that is used often, you could cache different
copies dependent on context (e.g dependent on user and loale, if you
have login-dependent pages and multiple languages). An example for this
would be the cache setting "session;locale".
So, the flex cache is really quite powerful and allows you to tell
opencms under which circumstances existing cached pieces of content may
be re-used and when a piece of output should be re-generated and cached
independently from earlier permutations that were generated by the same
template or for the same page.
I hope that you ge the idea.
Kind Regards
Christian
>
> The rendered output of JSP pages and elements can be cached in the so
> called "FlexCache". In order to improve the performance of a site by
> avoiding unnecessary generation of the same output multiple times, we
> recommend to cache all JSP elements that are dynamically generated where
> possible, especially navigation elements. The FlexCache is able to store
> different variants of an element according to URIs, request parameters
> and other values. All dynamically included JSP elements of a template
> can be cached separately. So, a mixture of cached elements and
> dynamically generated elements is possible. Important: the cache is
> cleared automatically if something is published.
>
> The caching of a JSP is controlled by using the "cache"-property.
> Depending on the value of this property, the JSP is cached in different
> ways.
>
> Examples:
> -> cache=always - There is only one variant of the page generated which
> is stored permanently in the cache.
>
> -> cache=never - The element is not cached and generates it’s output for
> each request.
>
> If the property "cache" is undefined, this is equivalent to cache=never
>
> The system supports the following keys in the "cache"-property:
>
> - always (true)
> - never (false)
> - uri
> - params=({param1, param2})
> - no-params=({param1, param2})
> - timeout={number}
> - element
> - ip
> - locale
> - encoding
> - schemes
> - ports
> - user
> - session
> - site
>
> You can download a documentation module at
> http://opencms.org/en/download/documentation.html
>
>
More information about the opencms-dev
mailing list