Cache stores provide logical block storage backed by two other stores, a primary store and a cache. Blocks are added to the cache on reads and writes, and evicted with a least-recently-used strategy to keep the cache under a certain total size. Operations on this store will prefer to look up blocks in the cache, and fall back to the primary store when not available.
Because the caching logic runs locally, the backing cache storage should not be shared among multiple concurrent processes.
Cache stores provide logical block storage backed by two other stores, a _primary store_ and a _cache_. Blocks are added to the cache on reads and writes, and evicted with a least-recently-used strategy to keep the cache under a certain total size. Operations on this store will prefer to look up blocks in the cache, and fall back to the primary store when not available. Because the caching logic runs locally, the backing cache storage should not be shared among multiple concurrent processes.
(caching-block-store size-limit & {:as opts})
Creates a new logical block store which will use one block store to cache
up to a certain size of content for another block store. The store should
have a :primary
and a :cache
associated with it for backing block
storage.
Supported options are:
:max-block-size
do not cache blocks larger than this size:primary
set a backing primary store:cache
set a backing cache storeCreates a new logical block store which will use one block store to cache up to a certain size of content for another block store. The store should have a `:primary` and a `:cache` associated with it for backing block storage. Supported options are: - `:max-block-size` do not cache blocks larger than this size - `:primary` set a backing primary store - `:cache` set a backing cache store
(reap! store target-free)
Given a target amount of space to free and a cache store, deletes blocks from the cache to free up the desired amount of space. Returns a summary of the deleted entries.
Given a target amount of space to free and a cache store, deletes blocks from the cache to free up the desired amount of space. Returns a summary of the deleted entries.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close