<< Back - Alkacon logo

OpenCms 6.0 interactive documentation:

FlexCache examples

OpenCms logo - Forward >>

Some FlexCache examples

On this page you find some examples to demonstrate the OpenCms FlexCache mechanism. Read the page Cache Directives to learn how to attach FlexCache directives to a resource. For a detailed description of the used cache directives look at the page Cache Directives Reference.

Page inclusion with different cache directives

In this example a JSP file is included by another one. The cache property of the first file is set to "never", which means that this resource is never cached. The cache property of the included file is set to "timeout=1", which means that the cache entry for this file is cleared every full minute. Click here to have a look at the example and watch the values of the dates displayed when you refresh the example page.

You can see that you can set the caching properties for each file individually and that these directions are considered even if one file is included by another.

Another inclusion

Another example for an inclusion, this time with other cache directives. The cache property of the first file is set to "always", which means that there will always be the same result generated for all requests. The cache property of the included file is set to "never". Refresh the page example-include2.jsp to see effects of the different cache directives.

A simple navigation

The file example-navigation.jsp builds a simple navigation tree for the current folder. The cache property of the file is set to "uri", which means that one cache entry of this resource is generated for every "top level" URI that is called.

©2003-2005 Alkacon Software (http://www.alkacon.com) - The OpenCms experts