Whatever message this page gives is out now! Go check it out!

CacheGetAllIds

Last update:
May 18, 2026

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

Function syntax

CacheGetAllIds(cacheName, isAccurate)

Parameters

Parameter
Description
cacheName
The name of the cache region
isAccurate
(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

History

ColdFusion (2018 release): Renamed parameters Region to cacheName and accurate to isAccurate.
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>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page