Cached Values
Calculations are computationally expensive, but setting and retrieving values is fast so storing values in a cache has a speed benefit. You can perform calculations in one report run, and use them in subsequent runs. Do not store any sensitive data in the cache as it is available for all other users of the system.
ReportMagic supports up to 10,000 cached values per customer account.
Scopes
When setting a cache, there are two options for the scope parameter. Use Local unless you need to use Global:
- Local applies to just this Report Schedule
- Global applies to the entire account
If you are using Report Studio, you must use Global, as Local is not supported.
Some examples are given below. See the individual macros for more information.
Examples
[Cache.Set:]
Example: [Cache.Set:key=ABC, value=123, scope=Global, expires=2075-02-17]
This example would set a key/value pair of ABC=123. When you need to retrieve the cache you will refer to the key. This expiry date that has been set is excessive - the value will be available until 2075-02-17. Please set a sensible expiry date.
[Cache.Get:]
Example: [Cache.Get:key=ABC]
This macro returns the value stored in the cache whose key is ABC.
[Cache.IsSet:]
Example: [Cache.IsSet:key=ABC]
This macro returns "true" if the value is stored in the cache, otherwise "false".
[Cache.Expires: ]
Example: [Cache.Expires:key=ABC]
This macro returns the expiry date if the value is stored in the cache, otherwise nothing.
[Cache.Unset:]
Example: [Cache.Unset:key=ABC]
This macro removes the value from the cache.
Managing Cached Values
Tenant Admins can manage (view, create, edit and delete) cached values using ReportMagic via the Admin -> Cached Values page, or in the TenantAdmin App here.