Whatever message this page gives is out now! Go check it out!
cacheRemoveAll(region)Parameter | Description |
region | (Optional) Indicates the cache region from which to remove the stored objects. If no value is specified, default cache region is considered by default. |
<cfscript>
// create cache region with no properties
rProps={};
CacheRegionNew("newRegion",rProps,true);
// create cache timespan and idle time
timeToLive = CreateTimeSpan(0, 0, 30, 0);
timeToIdle = CreateTimeSpan(0, 0, 30, 0);
// define objects to be inserted into cache region
foo1=foo2=foo3={};
// populate cache with values
cachePut("1", "foo1", timeToLive, timeToIdle, "newRegion");
cachePut("2", "foo2", timeToLive, timeToIdle, "newRegion");
cachePut("3", "foo3", timeToLive, timeToIdle, "newRegion");
WriteOutput("Before cacheRemove() :: Number of objects in the cache:" & ArrayLen(cacheGetAllIds("newRegion")));
//clear all objects from the cache
cacheRemoveAll("newRegion");
WriteOutput("After cacheRemove() :: Number of objects in the cache:" & ArrayLen(cacheGetAllIds("newRegion")));
</cfscript>