All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Prefixed the variable names internally. Previously, naming your function variables as
key
orresult
could cause conflicts, but now the chances of collisions are reduced. - When your functions return
Result
, errors must also beClone
able. - Improve
moka
performance.
- All memory calls are synced, so
sync_writes
flag is removed. - Removed support of
async_std
. Andredis_async_std
feature flag.
-
Now we use msgpack to store data in Redis, and not JSON.
It's considered as a breaking change, since it will return error for existing caches. Because of this, the default Redis namespace has also changed. And you may need to clean the Redis cache manually.
- Many
clone
s are remove from the Redis integration. So it's expected to becomes a little faster. - Remove the dependency to
serde_json
- Add support for LFU caching, alongside the existing LRU cache
-
This version encounters a breaking change, because from this version on, the default algorithm is LFU.
If you want to use LRU, you need to pass
eviction_policy="lru"
.
- Type of
ttl
inkash
is string. So you can pass functions or consts. - All
disk
andredis
specific attributes, went inside parentheses. Like#[kash(disk(dir = "/dir/"))]
instead of#[kash(disk, disk_dir = "/dir/")]
- Change
disk_dir
attribute todir
- Change
cache_prefix_block
attribute toprefix_block
- Now
key
has two children elements,ty
andexpr
. Basicallyty
is the old value ofkey
andexpr
is the value ofconvert
.
- Remove
io_kash
, instead you can simply usekash
convert
attribute has been removed from the root of configurations. Useexpr
attribute insidekey
attribute.
- Remove
map_error
param. Instead, you can implFrom<DiskCacheError>
orFrom<RedisCacheError>
for your result.
- Remove
wrap_result
flag
- Fork from the source project: https://github.com/jaemk/cached/
- Organize and cleanup some codes
- Set MSRV to 1.76
- Support functions inside
impl
- Add edition 2021
time
change tottl
- Change custom implementation of memory cache and use
moka
- Remove wasm support, since
moka
doesn't support it - Remove
cache!
declarative macro. Now you can only use attribute macros, like#[kash]
- Remove
#[once]
macro. Instead, you can use#[cache]
with a customkey
asbool
, for example - It's not possible anymore to use custom cache definitions, you may need to use
cached
library instead