PlatformCachePartition

Represents a partition in the Platform Cache.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

PlatformCachePartition components have the suffix .cachePartition and are stored in the cachePartitions folder.

Version 

Introduced in API version 35.0.

Special Access Rules 

The “Author Apex” permission is required to deploy and retrieve PlatformCachePartition components.

Fields 

description 

  • Type: string
  • Required: No
  • Description: Describes the cache partition.

isDefaultPartition 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether this cache partition is the default partition in your organization (true) or not (false).

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. The label of the cache partition that appears in the Salesforce user interface.

platformCachePartitionTypes 

PlatformCachePartitionType Type 

Contains information about a partition type, including its minimum and allocated capacity.

Fields 

allocatedCapacity 

  • Type: int
  • Required: Yes
  • Description: Required. The total storage capacity, in megabytes (MB), that is allocated for the cache type, including free, purchased, and trial cache. Purchased capacity includes organization-wide cache, which can be used in any partition, and namespace-specific cache, which can be used only in partitions associated with a namespace.

allocatedPartnerCapacity 

  • Type: int
  • Required: Yes
  • Introduced: API version 51.0
  • Description: Required. Free capacity, in megabytes (MB). allocated to Developer Edition orgs for the cache type. Use this capacity with security-reviewed managed packages.

allocatedPurchasedCapacity 

  • Type: int
  • Required: Yes
  • Description: Required. The amount of namespace-specific purchased storage capacity, in MB, that is allocated for the cache type.

allocatedTrialCapacity 

  • Type: int
  • Required: Yes
  • Description: Required. The amount of trial cache space, in MB, that is allocated for the cache type.

cacheType 

  • Type: PlatformCacheType (enumeration of type string)
  • Required: Yes
  • Description: The type of cache.
  • Possible values:
    • Session — Session cache
    • Organization — Org cache

Declarative Metadata Sample Definition 

The following is an example of a PlatformCachePartition component.

1<?xml version="1.0" encoding="UTF-8"?>
2<PlatformCachePartition xmlns="http://soap.sforce.com/2006/04/metadata">
3    <description>Custom partition and marked as default.</description>
4    <isDefaultPartition>true</isDefaultPartition>
5    <masterLabel>myPartition</masterLabel>
6    <platformCachePartitionTypes>
7   ​​     <​allocatedCapacity>10</​allocatedCapacity>
8​​        <​​allo​ca​tedPurchasedCapacity>5</​​allo​ca​tedPurchasedCapacity>
9        <cacheType>Session</cacheType>
10    </platformCachePartitionTypes>
11    <platformCachePartitionTypes>
12    ​​    <​allocatedCapacity>5</​allocatedCapacity>
13​​        <​​allo​ca​tedPurchasedCapacity>5</​​allo​ca​tedPurchasedCapacity>
14        <cacheType>Organization</cacheType>
15    </platformCachePartitionTypes>​
16</PlatformCachePartition>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>myPartition</members>
5        <name>PlatformCachePartition</name>
6    </types>
7    <version>68.0</version>
8</Package>

If a namespace is defined in your organization, add the namespace prefix to your partition name. For example:

1<members>Namespace.myPartition</members>

To retrieve all cache partitions from your organization, use the wildcard character (*) as follows.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>*</members>
5        <name>PlatformCachePartition</name>
6    </types>
7    <version>68.0</version>
8</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.