Skip to content

Commit

Permalink
Update caching documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrebnov committed May 23, 2024
1 parent 14a9edd commit ec02ef4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
16 changes: 9 additions & 7 deletions spiceaidocs/docs/features/caching/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Spice supports in-memory caching of query results.

Results caching can help improve performance for bursts of requests and for non-accelerated results such as refresh data returned [on zero results](/data-accelerators/data-refresh.md#behavior-on-zero-results).

Results caching employs a [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) cache replacement policy with the ability to specific an item expiry duration which defaults to 1-second.
Results caching employs a [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) cache replacement policy with the ability to specify an item expiry duration, which defaults to 1 second.

```yaml
version: v1beta1
Expand All @@ -21,14 +21,16 @@ name: app
runtime:
results_cache:
enabled: true
cache_max_size: 128mb
item_expire: 1s
cache_max_size: 128MiB
eviction_policy: lru
item_ttl: 1s
```

- `enabled` - optional, `true` by default (if there is a non-empty `results_cache` section defined)
- `cache_max_size` - optional, maximum cache size. Default is `128MB`
- `item_expire` - optional, cache entry expiration time, 1 second by default.
- `enabled` - optional, `true` by default
- `cache_max_size` - optional, maximum cache size. Default is `128MiB`
- `eviction_policy` - optional, cache replacement policy when the cached data reaches the `cache_max_size`. Default is `lru` - [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU)
- `item_ttl` - optional, cache entry expiration duration, 1 second by default.

:::warning[Limitations]
- Results caching for Arrow Flight queries is not currently supported (coming soon).
- Cache currently supports only the [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) replacement policy.
:::
12 changes: 7 additions & 5 deletions spiceaidocs/docs/reference/spicepod/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ The results cache section specifies runtime cache configuration. [Learn more](/f
runtime:
results_cache:
enabled: true
cache_max_size: 128mb
item_expire: 1s
cache_max_size: 128MiB
eviction_policy: lru
item_ttl: 1s
```

- `enabled` - optional, `true` by default (if there is a non-empty `results_cache` section defined)
- `cache_max_size` - optional, maximum cache size. Default is `128MB`
- `item_expire` - optional, cache entry expiration time, 1 second by default.
- `enabled` - optional, `true` by default
- `cache_max_size` - optional, maximum cache size. Default is `128MiB`
- `eviction_policy` - optional, cache replacement policy when the cached data reaches the `cache_max_size`. Default is `lru` - [least-recently-used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU)
- `item_ttl` - optional, cache entry expiration time, 1 second by default.:

## `metadata`

Expand Down

0 comments on commit ec02ef4

Please sign in to comment.