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 should be setup properly, either programmatically and/or using the ehcache.xml file in your classpath.


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

Returned XML

This generator returns the following XML:

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

Error Handling

This generator will fail and throw 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 will potentially affect 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