You are here:
Set Up Cache for Calculation Matrices for Performance
To optimize performance for large calculation matrices or pricing plans that have many attribute-based pricing steps, you can cache your calculation matrices in the platform cache.
Caching is not needed for all calculation matrices. Small to medium-sized matrices will likely be quite fast. Salesforce recommends implementing your attribute-based pricing solution without a cache at first and creating the cache if additional speed is required.
The PricingPlanHelper Apex class caches calculation matrix data using the key AttrMatrixMap + {Matrix Id}, for example, AttrMatrixMapa1K46000002FATaE, in a custom org cache partition.
Calculation matrix data is not cached in the CPQPartition that is part of the CME managed package.
After you have implemented the caching feature, you must clear the cache every time you make a change to your calculation matrices to ensure your changes are reflected at runtime.
To cache your calculation matrices, create a custom partition in the platform cache, and then create a custom setting that stores the name of the custom partition as follows. The PricingPlanHelper.cls then detects your custom setting and stores your calculation matrices in the cache.
-
Create a custom partition:
- Go to Setup, and then type platform cache in the Quick Find search dialog box.
- Click New Platform Cache Partition.
-
In the Detail section, enter the following information.
Field
Value
Description
Label
AttributePricingPartition
The label to be displayed for this partition.
Name
AttributePricingPartition
The name of this partition. This value must be entered in the CPQ Configuration custom setting.
Default Partition
Do not select.
Description
Stores calculation matrices for attribute based pricing.
- In the Capacity section, under Org Cache Allocation specify the amount of cache for the PricingPlanHelper Apex class to use. Do not enter an allocation amount for the session cache since it is not used by the PricingPlanHelper.cls
-
Create the AttrMatrixInfoCachePartition custom setting.
- Go to the Vlocity CMT Administration tab.
- In the Custom Settings area, click CPQ Configuration Setup.
- Scroll to the bottom of the page, and click Add.
- In the first box, enter AttrMatrixInfoCachePartition.
- In the second box, enter AttributePricingPartition (or the name of the partition you created above).
- Click Save.

