Skip to main content


Advanced topics

Generator: ClearCache

Class name:org.weborganic.bastille.cache.ClearCache
Version:24 November 2011


Clears the cache content.

If a cache name is specified, then only this cache is cleared; otherwise, all caches are cleared.


This generator does not require any specific configuration.

Ensure that your caching library is setup properly, either programmatically and/or using the ehcache.xml file in your classpath.


The name parameter can be used to specify a particular cache to clear. All caches are cleared if no specific cache name is given.

Returned XML

This generator returns the following XML:

  <!-- for each cache that was cleared -->
  <cache name="[name]" guid="[identifier]"/>

Error Handling

This generator fails and throws an error if an error is reported by the cache engine.


This generator should generally be protected and require authentication by an administrator since it potentially affects the performance of ALL generators.

It is also recommended that this generator be associated with a service using the POST HTTP method.


To clear a specific cache:

<generator class="com.weborganic.bastille.cache.ClearCache" ...>
  <parameter name="name" value="[name]" />

 To clear all caches:

<generator class="org.weborganic.bastille.cache.ClearCache" ... /> 
Created on , last edited on