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


Argument Reference for the cacheRemoveAll function


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()))> 
 <!--- 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)> 
 <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