UTIL_Cache.Scope
Class
apex
global enum UTIL_Cache.ScopeCache type enumeration
Since: 1.0
Values
| Value | Description |
|---|---|
| global AUTO | Auto-select dispatch: Session first, fallback to Org. |
| global IN_TRANSACTION | Transaction cache (in-memory, lifetime = current Apex transaction). |
| global ORG | Org cache (TTL: 5 minutes to 48 hours) |
| global SESSION | Session cache (TTL: 5 minutes to 8 hours) |
Value Details
AUTO
apex
global AUTOAuto-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_TRANSACTIONTransaction 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 ORGOrg cache (TTL: 5 minutes to 48 hours)
SESSION
apex
global SESSIONSession cache (TTL: 5 minutes to 8 hours)