Platform Cache Session partition concurrency and Manage Platform Cache permission boundary
0 reputation · 02 Sept 2026, 06:13 UTC
Design goal is to use Session Cache to avoid repeated expensive computation when several Apex requests for the same user arrive concurrently.
Platform Cache provides Org Cache and Session Cache partitions configured in Setup. Session Cache is scoped to the authenticated user session and is invalidated when the session ends. Apex Cache.Org and Cache.Session have no built-in per-key lock or atomic get-or-compute operation. TTL for Org Cache is best-effort and eviction can occur under memory pressure without application notification. Creating or editing cache partitions requires the Manage Platform Cache permission; Apex read/write access depends on partition visibility settings.
The permission boundary and concurrency behavior are unclear for a design that expects a single recomputation per session key under load.
Does Manage Platform Cache permission control Apex read/write access to an existing Session partition, or only partition creation and configuration? Is duplicate recomputation under concurrent misses the documented behavior for Session Cache? What guarantees, if any, exist for key-level consistency during simultaneous put operations within the same session?