-
Notifications
You must be signed in to change notification settings - Fork 519
PlatformCacheRecipes
Illustrates how to programatically use the Platform Cache feature of Salesforce. Many of these recipes are, taken together, not very DRY (don't repeat yourself). However, they're intentionally listed here as a way of repeatedly demonstrating Platform Cache functionality
Enum for partition type.
Defines the default cache partition for use in this class.
returns a Cache.Partition for a given name, and type
| Param | Description |
|---|---|
type |
Enum of .SESSION or .ORG |
Type
Cache.Partition
Description
Cache.Partition
Retrieves a value from the cache identified by key
| Param | Description |
|---|---|
key |
String key of which value to retrieve. |
Type
String
Description
String
Retrieves a value from the cache identified by key
| Param | Description |
|---|---|
key |
String key of which value to retrieve. |
Type
String
Description
String
removes a key/value from the cache manually
| Param | Description |
|---|---|
key |
String key to remove |
removes a key/value from the cache manually
| Param | Description |
|---|---|
key |
String key to remove |
Stores a value in the Org cache with a default timeout of 3600 seconds (1hr)
| Param | Description |
|---|---|
key |
String name of key used to store the value in the cache. |
toStore |
String value to store in the cache. |
Stores a value in the Org cache with a custom timeout.
| Param | Description |
|---|---|
key |
String Name to the store the value under. |
toStore |
String to store in the cache |
ttl |
Integer Time To Live (ttl) is the number of seconds this |
Stores a value in the Session cache with a default timeout of 3600 seconds (1hr)
| Param | Description |
|---|---|
key |
String name of key used to store the value in the cache. |
toStore |
String value to store in the cache. |
Stores a value in the Session cache with a custom timeout.
| Param | Description |
|---|---|
key |
String Name to the store the value under. |
toStore |
String to store in the cache |
ttl |
Integer Time To Live (ttl) is the number of seconds this |
internal custom exception class.