Local Cache
The Local Cache plugin provides an in-memory key-value cache within a Linx solution. Use it to avoid repeated calls to external systems — for example, caching settings or reference data that would otherwise require a database query on each use.
The plugin adds a Cache service to your solution. A solution may contain multiple Cache service instances; each operates independently with no shared state. Starting or stopping the service flushes all cached entries.
Cache service properties
Section titled “Cache service properties”Value type
Section titled “Value type”The type of values stored in this cache. Accepts any built-in Linx type or a custom type defined in the solution. All entries in a cache share this type.
Defaults to string.
Expiry
Section titled “Expiry”Seconds before a cached entry expires, measured from when the specific entry was set. 0 means entries do not expire.
Defaults to 0.
Service functions
Section titled “Service functions”-
TryGet: Retrieves a value from the cache by key. Returns a result object with a
WasFoundflag and the cachedValue. -
Set: Stores a value in the cache. Overwrites any existing entry with the same key.
-
Remove: Removes a cached entry by key. No error is raised if the key does not exist.