Platform Cache
Salesforce’s Platform Cache feature is a feature that allows a developer to designate cache partitions tied to either a user’s session or the entire org, which holds data that is often retrieved but changes infrequently (slow-moving data). Examples may include exchange rates in an org cache or a user’s current location in a session cache.
To manage data within Platform Cache, it is a best practice to use a partition, ensuring that you can distribute cache space effectively and that the data is not overwritten incorrectly.
In the following screenshot, you can see a partition that I have defined in the cache to store Foreign eXchange (FX) rates for us to use:
Figure 20.5 – Declaring a Platform Cache partition
For the purpose of this example, let’s assume that we want to get a near-live feed of exchange rates, with the rate expiring and needing to be refreshed every 15 minutes. We will assume for this...