CacheGet()

Gets an object that is stored in the cache.

CacheGet( id=string, throwWhenNotExist=object, cacheName=string );

Returns: object

Argument Description Default
id
string, required

name of the element to return

Alias: name, key

throwWhenNotExist
object, optional

define if the functions throws an exception when the element does not exist.

Default is false.

false

cacheName
string, optional

definition of the cache used by name, when not set the "default Object Cache" defined in Lucee Administrator is used instead.

Alias: cache, region

Examples

cachePut(id:'abc', value:'123',timeSpan:CreateTimeSpan(0,0,0,1),cacheName:'fruits');
  getcache = cacheGet(id:'abc',cacheName:'fruits');
  writeDump(getcache);

See also