CacheTower Versions Save

An efficient multi-layered caching system for .NET

0.14.0

9 months ago

What's Changed

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-in NullLogger. 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 a CacheStackOptions
  • Replaced ICacheRefreshCallSiteWrapperExtension with IDistributedLockExtension, 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

Full Changelog: https://github.com/TurnerSoftware/CacheTower/compare/0.13.0...0.14.0

0.13.0

1 year ago

Breaking Changes

  • Remove Abstract CacheEntry / Use C# Records by @Turnerj (#206)

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 (00b8e78275c93f4efb0fc34e1af197b855890ef0)
  • More dependency injection improvements by @Turnerj (#208)
  • Updating referenced dependency versions (41f951d7cb7e78f57086dd49774beeec28c1496a & #210)
  • Minor performance improvements (5c9cf83408530140cc586a7de98ea0abdbd74249)
  • Fixed package metadata (14bf52da61d5573d3f8a49c0af8548afefe1da24)

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

1 year ago

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 on CacheTower.Serializers.Protobuf for backwards compatibility for 0.12.0 and will be changed in a future release. There is a new constructor that ICacheSerializer allowing you to specify any serializer you want. The transitive dependency on CacheTower.Serializers.Protobuf will be removed in a future version.
  • JsonFileCacheLayer and ProtobufFileCacheLayer are now obsolete, instead use FileCacheLayer and specify an ICacheSerializer 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

2 years ago

Changes

This version fixes a subtle but annoying bug introduced in 0.9.0 where expired entries, under certain conditions, were not being refreshed.

🐛 Bug Fixes

  • Prevent returning expired entries by @Turnerj (#196)

👨🏼‍💻 Contributors

@Turnerj

0.11.5

2 years ago

Changes

🐛 Bug Fixes

  • NullReferenceException on blocked task when original task faulted by @rgueldenpfennig (#193)

👨🏼‍💻 Contributors

@Turnerj, @rgueldenpfennig and Robin Gueldenpfennig

0.11.4

2 years ago

Changes

🐛 Bug Fixes

  • Fix file manifest load issues by @Turnerj (#188)

👨🏼‍💻 Contributors

@Turnerj

0.11.3

2 years ago

Changes

  • Add docs for ICacheContextActivator by @mgoodfellow (#186)

🐛 Bug Fixes

  • Fix issue with CacheStack not being disposed by @Turnerj (6b0d912)

👨🏼‍💻 Contributors

@Turnerj and @mgoodfellow

0.11.2

2 years ago

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

2 years ago

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

0.11.0

2 years ago

Note: There were package reference issues with 0.10.0 that are now resolved in this release. All other changes from 0.10.0 are in this version too.

Changes

  • Prevent RedisRemoteEvictionExtension evicting new entries (#178)

👨🏼‍💻 Contributors

@Turnerj