Skip to content

UTIL_Cache.Scope

Class

apex
global enum UTIL_Cache.Scope

Cache type enumeration

Since: 1.0


Values

ValueDescription
global AUTOAuto-select dispatch: Session first, fallback to Org.
global IN_TRANSACTIONTransaction cache (in-memory, lifetime = current Apex transaction).
global ORGOrg cache (TTL: 5 minutes to 48 hours)
global SESSIONSession cache (TTL: 5 minutes to 8 hours)

Value Details

AUTO

apex
global AUTO

Auto-select dispatch: Session first, fallback to Org. Durable-only — this scope does not silently fall back to per-transaction storage when Platform Cache is unallocated. Subscribers that want graceful degradation use the autoWithTransactionFallback() factory instead.

IN_TRANSACTION

apex
global IN_TRANSACTION

Transaction cache (in-memory, lifetime = current Apex transaction). Used by inTransaction() and as the fallback tier in autoWithTransactionFallback(). Never serializes; no key-name restrictions; no quota; always available. Identifier is IN_TRANSACTION because TRANSACTION is a reserved Apex identifier.

ORG

apex
global ORG

Org cache (TTL: 5 minutes to 48 hours)

SESSION

apex
global SESSION

Session cache (TTL: 5 minutes to 8 hours)