Description

Gets the IDs of all objects stored in the cache.

Returns

An array containing the IDs of all the objects that are stored in the cache.

Category

Cache functions

Function syntax

CacheGetAllIds(region,boolean accurate)

Parameters

Parameter

Description

region

(Optional) The name of the cache region

accurate

(Optional) Boolean. Default is True. When set to false, CacheGetAllIds will return the result faster. However, the result may not be accurate.

If you need only the IDs of valid (unexpired) objects from the cache, set accurate to true. If you set accurate to false, the IDs of all the objects in the cache will be returned.

See also

cfcacheCachePutCacheGetCacheGetMetadataCacheGetPropertiesCacheRemoveCacheSetProperties

History

ColdFusion 11: Added the parameter accurate.

ColdFusion 10: Added the parameter region.

ColdFusion 9: Added the function.

Example

<cfscript>
       // create a cache region with no properties
       rProps={};
       CacheRegionNew("myRegion",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 the cache with ids and objects
       cachePut("1", "foo1", timeToLive, timeToIdle, "myRegion");
       cachePut("2", "foo2", timeToLive, timeToIdle, "myRegion");
       cachePut("3", "foo3", timeToLive, timeToIdle, "myRegion");
       // display the ids. Ids are displayed as array
       Writedump(CacheGetAllIds("myRegion",true));
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy