Releases: TurnerSoftware/CacheTower
0.14.0
What's Changed
- Remove the RefreshAsync closure by @danielmarbach in #211
- Improve the GetOrSetAsync state machine by @Turnerj in #212
- Improve serialization handling by @Turnerj in #217
- Simplify distributed locking extension system by @Turnerj in #240
- Add CacheStackOptions for easier extendability by @Turnerj in #241
- Upgrade StackExchange.Redis to v2.6.122 by @Turnerj in #258
Breaking Changes / Notes
- Some obsolete extension methods on service collections have been removed
- Cache Tower now takes a dependency on
Microsoft.Extensions.Logging.Abstractions
. If you don't have logging configured, it will internally default to the built-inNullLogger
. This was done as part of the serialization changes to stop exceptions crashing out during caching but as a way they are still logged. - Deprecated some constructors for
CacheStack
in favour of using a constructor which takes aCacheStackOptions
- Replaced
ICacheRefreshCallSiteWrapperExtension
withIDistributedLockExtension
, a simplified alternative to handling distributed locking - Major rewrite to
RedisLockExtension
for distributed locking
Besides the removal of some obsolete extension methods on service collections, the rest of these changes shouldn't affect the most common scenario of using Cache Tower via Dependency Injection.
New Contributors
- @danielmarbach made their first contribution in #211
Full Changelog: 0.13.0...0.14.0
0.13.0
Breaking Changes
This is mainly an internal implementation change as CacheEntry
was publicly passed around as CacheEntry<T>
which is still there with the same constructor and properties. If you were using CacheEntry
somewhere, you'll likely be able to switch it out for ICacheEntry
instead. The change is being explicitly called out in case any subtle behaviour changes occur because of it.
Other Changes
- Enable CLS compliance checks by @Turnerj (#209)
- Embedded debug symbols (00b8e78)
- More dependency injection improvements by @Turnerj (#208)
- Updating referenced dependency versions (41f951d & #210)
- Minor performance improvements (5c9cf83)
- Fixed package metadata (14bf52d)
The dependency injection improvements are around passing in an IServiceProvider
into the builder pattern and supporting named cache stacks. This makes it easier to configure your cache stacks for the code that consumes them.
0.12.0
Major Changes
There are a number of breaking changes in this release of Cache Tower. For the most part, these APIs will be marked as "obsolete" and should still behave as they did previously however it is important to recognise the changes that have occurred to understand the breadth of incompatibility.
Support for Custom Serializers (#172, #205)
Rather than restricting cache layers to specific serializers, you can now supply custom serializers to cache layers that require it. Officially, Cache Tower will support 3 serializers: Newtonsoft.Json, System.Text.Json and Protobuf (via protobuf-net).
RedisCacheLayer
currently takes a dependency onCacheTower.Serializers.Protobuf
for backwards compatibility for0.12.0
and will be changed in a future release. There is a new constructor thatICacheSerializer
allowing you to specify any serializer you want. The transitive dependency onCacheTower.Serializers.Protobuf
will be removed in a future version.JsonFileCacheLayer
andProtobufFileCacheLayer
are now obsolete, instead useFileCacheLayer
and specify anICacheSerializer
to use.
Additional changes to note:
- File caching no longer specifies file extensions as they are redundant when serializers define the format. This means existing file caches will be empty after upgrading.
JsonFileCacheLayer
used to specifically serialize your data wrapped in its own JSON object (eg.{"value": _ }
) which it no longer does. Due to the file extension change, this shouldn't cause a problem as your cache will be empty. Through additional unit tests, this doesn't seem to cause a problem however if you hit an issue where it does, please raise an issue.
File Caching Changes (#203, #172)
One problem that has been raised a few times are issues around the manifest files for caching. The manifest was only writing down to the file system when the application gracefully exited. Manifests now save automatically in the background and the interval is controllable via options on the FileCacheLayer
.
Additionally, there were two other fixes:
- Prevent exceptions when attempting to read a file that doesn't exist (when detected now, the entry is removed from the manifest and treated like a cache miss)
- Changes to the
FileMode
access to force truncation of data when serializing (this may have been causing specific types of cache entry corruption)
Fluent Dependency Injection Building (#204)
The fluent dependency injection process simplifies configuring Cache Tower and will be recommended method going forward. There are some minor API breaking changes when you upgrade, even if you don't use the fluent API around how certain cache layers and extensions are configured.
There are some underlying changes to how the RedisRemoteEvictionExtension
works - you no longer can specify which cache layers to evict from. Cache layers are now decorated with ILocalCacheLayer
and IDistributedCacheLayer
which the extension uses to identify what cache layers it will evict from. Specifically, no distributed cache layer will be evicted from by the extension.
Changes to RedisLockExtension
have occurred around how you specify certain options, specifically around specifying a LockCheckStrategy
to choose between a pub/sub or spin lock strategy.
0.11.6
0.11.5
Changes
🐛 Bug Fixes
- NullReferenceException on blocked task when original task faulted by @rgueldenpfennig (#193)
👨🏼💻 Contributors
@Turnerj, @rgueldenpfennig and Robin Gueldenpfennig
0.11.4
0.11.3
Changes
- Add docs for ICacheContextActivator by @mgoodfellow (#186)
🐛 Bug Fixes
👨🏼💻 Contributors
@Turnerj and @mgoodfellow
0.11.2
Changes
- Fixed some missing/incorrect XML docs by @Turnerj
🐛 Bug Fixes
- Fix to always release Subscriber locks by @mgoodfellow (#185)
- Add busy lock support for
RedisLockExtension
by @mgoodfellow (#184)
👨🏼💻 Contributors
@Turnerj and @mgoodfellow
0.11.1
Changes
- Make sure subscriptions are cleared on ResetState by @mgoodfellow (#182)
🐛 Bug Fixes
- Prevent indefinite Redis cache lock by @mgoodfellow (#183)
👨🏼💻 Contributors
@Turnerj and @mgoodfellow