vit_cache 2.1.1
vit_cache: ^2.1.1 copied to clipboard
A Dart package for caching single values and multiple key-value pairs with a time-to-live (TTL) mechanism.
2.1.1 #
- Updated documentation.
2.1.0 #
Improvements:
- Removed redundant
fetchparameter fromMultiTimedCacheconstructor - Simplified API by using only
fetchManyfunction for all fetch operations
Migration Guide:
- Remove the
fetchparameter fromMultiTimedCacheconstructor calls - Ensure your
fetchManyfunction can handle single-key requests (it should already work as-is)
2.0.0 #
BREAKING CHANGES:
- Converted
SingularCachefrom abstract class to concrete class with constructor parameters - Converted
MultiTimedCacheModeltoMultiTimedCacheconcrete class with constructor parameters - Renamed
MultiTimedCacheModel.setMany()toMultiTimedCache.ensureCached() - Replaced internal
MultiCacheItemwith genericCachedItemclass - Added
MultiTimedCache.simpleCachegetter for accessing cache without metadata - Updated API to use function parameters instead of method overrides for fetch operations
New Features:
- Added
CachedItem<T>model class for better cache item representation - Improved constructor-based API for easier usage without inheritance
Migration Guide:
- Replace
class MyCache extends SingularCache<T>withSingularCache<T>(ttl: duration, fetch: () async => ...) - Replace
class MyCache extends MultiTimedCacheModel<K, V>withMultiTimedCache<K, V>(ttl: duration, fetch: (key) async => ..., fetchMany: (keys) async => ...) - Replace
setMany()calls withensureCached()
1.1.1 #
- Fixed ttl calculating when dealing with milliseconds.
- Fixed problems while dealing with expired items in "clearExpired" and "setMany" of
MultiTimedCacheModel.
1.1.0 #
- Added "assumeAllPresent" option to
MultiTimesCacheModel.getMany.
1.0.0 #
- Initial version.