Flex cache settings
The flex cache caches the HTML output of JSPs in the memory (RAM) of your server. We demonstrate different variants of caching. Therefore, we include two JSPs into each other, both showing the current time. Playing with the cache directives set on the JSPs, the time is refreshed differently. Futhermore, we show how navigation should be cached.
The result
Below you'll find three examples. Each example is a dynamic function, whose provider JSP includes another JSP. Reload this page in the online project and see how the time changes (or not). Also note that the navigation renders differently on different pages. For each page one version is cached.
File: include-example1.jsp
The Date is Thu Jan 28 02:49:53 CET 2021
Cache properties: never
File: include-target1.jsp
The Date is Thu Jan 28 02:49:53 CET 2021
Cache properties: timeout=1
File: include-example2.jsp
The Date is Wed Jan 27 14:20:24 CET 2021
Cache properties: always
File: include-target2.jsp
The Date is Thu Jan 28 02:49:53 CET 2021
Cache properties: never
A sample navigation
Cache properties: uri
Pages on the current navigation level:
- Advanced container usage
- Element settings
- Common element settings
- Dynamic functions
- Function detail pages
- Pasting Scripts into contents
- Flex cache settings
- Navigation level
- Inline editing
- Image drag'n'drop
- Head includes
- Meta mappings
- Image scaling
- Scaling images for source sets
- Accessing container-page information
- PDF generation
- PDF thumbnail generation
- Dependent editor fields
- Lists and detail pages
- Lists and detail pages II
- Lists and detail pages III
Example resources and the interesting spots
The interesting parts here are not the JSPs themselves, but the properties set there.
If you are offline, open the workplace's explorer view in the root site and go to the following folder to see the resources used in the examples:
In this folder, you'll find all resources that are used. Right-click on a resource and choose "Properties" in the context menu to view the properties. In the "Individual properties" tab you'll find the cache settings.
To see that the JSP's output is really cached, go to the workplace's administration view and choose "Cache Administration". In the frame "Browse cache contents", click "Flex Cache". There you'll find a listing of all flex-cache entries. Click on "Variations" (upper-right corner of the listing) to see the different variations that are cached.
You can improve this page
Please contribute your suggestions or comments regarding this topic on our wiki. For support questions, please use the OpenCms mailing list or go for professional support.