cacheRemoveAll

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

cacheRemoveAll(region__);

Argument Reference for the cacheRemoveAll function

region

Required: No
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


Tag Syntax

the in-memory file system memory set in cfadmin and should return that.

<!--- clear all object caches ---> 
 <cfif arrayLen(cacheGetAllIds()) gt 0> <cfset cacheRemove(arrayToList(cacheGetAllIds()))> 
 </cfif> 
 <!--- create few caches ---> 
 <cfloop from='1' to='10' index='i'> 
 <cfset id = 'cache_#i#'> 
 <cfset timeToLive = createTimespan(0,0,30,0)> <cfset timeToIdle = createTimespan(0,0,30,0)> 
 <cfset cachePut(id,createQryObj(i),timeToLive,timeToIdle)> 
 </cfloop> 
 <cfoutput>Before cacheRemove() :: Number of objects in the cache: #arrayLen(cacheGetAllIds())#<br></cfoutput> 
 <!--- clear all objects from the cache ---> 
 <cfset cacheRemoveAll()> 
 <cfoutput>After cacheRemove() :: Number of objects in the cache: #arrayLen(cacheGetAllIds())#<br><br></cfoutput> 

Fork me on GitHub