Caching

The Content Front framework supports cacing at all levels of nested rendered content, but it is recomended to cache at as high a level as posible. Small pieces are fast to render anyways.

To cache the rendered result of a content object, and all rendered sub-views, add the attribute cacheTime

<cms:render content="${article}" cacheTime="10000"></cms:render>

Setup

The demo application is configured with caching enabled.

To enable caching, a caching proxy jsp must be present at WEB-INF/cachingproxy.jsp

To use OSCache for caching, the content of the file can be:

<oscache:cache key="${cacheKey}" time="${cacheTime}" scope="application">
<jsp:include page="${jsp}"></jsp:include>
<oscache:addgroup group="${ID}"></oscache:addgroup>
<c:forEach var="child" items="${viewController.children}">
<oscache:addgroup group="${child.content.ID}"></oscache:addgroup>
</c:forEach>
</oscache:cache>

The oscache:addgroup allows for invalidation of cached page fragments based on content IDs, even if the fragment rendering is nested.