WCM Basic / Advanced Caching can significantly improve the performance of a WCM system. There can be elements on the site though that are required to become visible right away or after a shorter period than the vast majority of the other items. Turning off caching or reducing the timeout globally could decrease performance too much though.
In an earlier post we described how to disable the advanced caching for specific WCM portlets to solve the challenge.
The preprocessor will not help though with WCM API calls being triggered outside of the WCM portlet - e.g. in the theme or in a custom portlet. In that case the following code can be used to disable the usage of the cache for the API call:
Map renderingParameters = renderingContext.getRequestParameters();
In case of AJAX calls from the browser to the server retrieving WCM content will leverage the basic / advanced cache if enabled. This can be prevented by adding the request parameters contentcache=none for advanced caching and cache=none for basic caching.
A sample URL could look like the following:
The cache parameters are described in more detail here:
It is also possible to specify a timeout for the cache for the calls via an expires parameter in the URL - this is described in detail here: