Whatever message this page gives is out now! Go check it out!
CacheRemove(id, [boolean throwOnError, String region, boolean exact])Parameter | Description |
id | A comma delimited string of IDs of the cached objects to remove. Starting from ColdFusion 11, you can also specify an array of IDs. |
throwOnError | (Optional) A Boolean value specifying whether to throw an exception if any ID does not specify a cached element. The default value is false. |
region | (Optional) Name of the cache region from which to remove the cached objects. |
exact | (Optional) If true, the search narrows down to values that exactly match the IDs (for removal). The default value is true. |
<cfscript>
// get all cache ids of cache region, myRegion
Writedump(cacheGetAllIds("myRegion",true));
//array of all cache ids are below:
// CACHE_1
// CACHE_3
// CACHE_2
// when exact=true, does not remove any objects, as no ids match
CacheRemove("cache",true,"myRegion",true);
Writeoutput("All cache ids are");
try{
Writedump(cacheGetAllIds("myRegion"));
}
catch(any e){
WriteOutput("Error: " & e.message);
}
</cfscript><cfscript>
// get all cache ids of cache region, myRegion
Writedump(cacheGetAllIds ("myRegion",true));
//array of all cache ids are below:
// CACHE_1
// CACHE_3
// CACHE_2
// when exact=false, removes all objects with partially matching ids
CacheRemove("cache",true,"myRegion",false);
Writeoutput("All cache ids are");
Writedump(cacheGetAllIds ("myRegion"));
</cfscript>