Skip to main content

Results Caching

Spice supports in-memory caching of query results, which is enabled by default for both the HTTP (/v1/sql) and Arrow Flight APIs.

Results caching can help improve performance for bursts of requests and for non-accelerated results such as refresh data returned on zero results.

Results caching employs a least-recently-used (LRU) cache replacement policy with the ability to specify an item expiry duration, which defaults to 1-second.

version: v1beta1
kind: Spicepod
name: app

runtime:
results_cache:
enabled: true
cache_max_size: 128MiB
eviction_policy: lru
item_ttl: 1s
Parameter nameOptionalDescription
enabledYestrue by default
cache_max_sizeYesMaximum cache size. Default is 128MiB
eviction_policyYesCache replacement policy when the cached data reaches the cache_max_size. Default and only currently supported value is lru
item_ttlYesCache entry expiration duration (Time to Live), 1 second by default.