cache Service
Local And Shared Cache capability acquired through a declared System Service.
Contract cache · 1.0.0-draft.1
Functions
get
Data value or null.
| Argument | Type | Required | Default |
|---|---|---|---|
| key | core.string | Yes | — |
Returns: core.data?
put
none.
| Argument | Type | Required | Default |
|---|---|---|---|
| key | core.string | Yes | — |
| value | core.data | Yes | — |
| ttlSeconds | core.integer | No | — |
Returns: core.void
Statement Only · No Return Value
remove
none.
| Argument | Type | Required | Default |
|---|---|---|---|
| key | core.string | Yes | — |
Returns: core.void
Statement Only · No Return Value
containsKey
Boolean.
| Argument | Type | Required | Default |
|---|---|---|---|
| key | core.string | Yes | — |
Returns: core.boolean
Behavior
- Local cache values are private to one execution engine and Service instance, and disappear on restart or unload. Shared cache values are visible to clients of the same configured store.
- Values are copied into and out of both caches. Mutating returned data does not mutate the cached entry. Handles and cyclic data cannot be cached.
- Local put may omit ttlSeconds. Zero adds no per-entry expiry; negative TTL fails. Configured capacity and expiry still apply.
- Shared put requires ttlSeconds. A zero or negative value requests an ordinary non-expiring write under that contract. Shared keys follow the System namespace convention.
- Cache effects do not join database transactions.