cacheRemoveAll

Removes all stored objects in a cache region. If no cache region is specified, objects in the default region are removed.

cacheRemoveAll( region );

cacheRemoveAll Argument Reference

region

Indicates the cache region from which to remove the stored objects. If no value is specified, default cache region is considered by default.

Examples sample code invoking the cacheRemoveAll function


Demonstrates the behavior using test data

// generate some data to cache
for ( i = 1; i <= 10; i++ ) {
  cachePut( 'cache_#i#', "Test data #i#" );
}

writeOutput( 'Before cacheRemove() :: Number of objects in the cache: #arrayLen( cacheGetAllIds( ) )#<br />' );

// clear all objects from the cache
cacheRemoveAll( );

writeOutput( 'After cacheRemove() :: Number of objects in the cache: #arrayLen( cacheGetAllIds( ) )#<br /><br />' );

Fork me on GitHub