Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Platform Cache entry
How-to guide

Set up a Platform Cache partition

Before any Apex can store values, an admin allocates Platform Cache capacity into a partition. You do this once in Setup, then reference the partition by name from code.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated Jun 16, 2026

Before any Apex can store values, an admin allocates Platform Cache capacity into a partition. You do this once in Setup, then reference the partition by name from code.

  1. Open Platform Cache in Setup

    In Setup, enter Platform Cache in the Quick Find box and open it. The page shows your org's total cache capacity, how much is allocated, and any existing partitions.

  2. Create a new partition

    Click New Platform Cache Partition. Give it a name that matches how you will reference it in Apex, such as RefData, and optionally a label and description.

  3. Allocate org and session capacity

    Enter how many megabytes of Org Cache and Session Cache this partition should hold. The combined allocation across all partitions cannot exceed your org's total capacity.

  4. Set the default partition if needed

    Mark one partition as the default so Apex calls that do not name a partition resolve to it. Save the partition to make it available to your code.

Key options
Org Cache Allocation (MB)remember

Memory reserved for data shared across all users and processes. A partition with 0 MB here silently ignores org-cache puts.

Session Cache Allocation (MB)remember

Memory reserved for per-user session data. Session values expire when the session ends, up to an 8-hour maximum TTL.

Default Partitionremember

When checked, this partition handles Cache.Org and Cache.Session calls that omit a partition name. Only one partition can be the default.

Gotchas
  • A partition with zero allocated capacity accepts put calls without error but stores nothing, so reads always miss.
  • Total allocation across every partition is capped at your org's purchased plus free capacity; you cannot over-allocate.
  • Developer Edition includes only a small free allocation, so test cache-miss paths there rather than assuming hits.

See the full Platform Cache entry

Platform Cache includes the definition, worked example, deep dive, related terms, and a quiz.