Skip to content

Releases: ZiggyCreatures/FusionCache

v0.19.0

12 Feb 21:16
Compare
Choose a tag to compare

🆕 Added DistributedCacheFailSafeMaxDuration option (docs)

After a request by the community member @RMcD a new entry option has been added to be able to specify a fail-safe max duration specific for the distributed cache level.

See here for more.

⚠ Behaviour change with stale data

After talking with community member @fkuhnert , an old thought re-emerged: for readonly methods like TryGet[Async] and GetOrDefault[Async] no stale data throttling should occur. This means that, even with fail-safe enabled, if there's some usable stale data it will be returned, BUT not saved. This makes sense, as a TryGet or a GetOrDefault does not suggest a "save" operation (see: Principle of Least Astonishment).

This should not change any apparent behaviour from the outside: the only thing potentially noticeable is that, if you have a large number of TryGet/GetOrDefault calls done on stale data, you may see some more of them going to the distributed cache, that's all.

🆕 Added ServiceStack JSON support

A new serializer is now available in its own package, to support the ServiceStack JSON serializer.

Thanks @mythz for yout support!

⛔ Added entry options normalization

Thanks to the community member @suhrab for spotting an edge case that could have been already handled.

When a user enable fail-safe and specifies a FailSafeMaxDuration lower than the Duration, the situation can feel messy since the thing being asked is not really in line with how FusionCache operates.

To avoid this, a new normalization phase has been added, to make all the values coherent with the situation.
In case a normalization occurs, FusionCache will also log it with a (configurable) Warning level.

See here for more.

📞 Added FactorySuccess event (docs)

A new event has been added that will trigger when a non-background factory completes successfully, after a request from community member @bartlomiejgawel (thanks for the tip!).
For the background one, keep using the BackgroundFactorySuccess event that already exists.

See here for more.

⚡ Performance Boost

When logging is enabled, FusionCache automatically generates a unique operation id per each operation (eg: each GetOrSet/GetOrDefault/TryGet/etc call) to make detective work easier while looking at the logs.

The generation of these operation ids now consumes 83% less cpu time and 45% less memory.

📕 Better docs

The docs has been expanded and refined: one of these changes is that in the Options now there's a clear indication about which entry options are compatible with adaptive caching, thanks to a chat with @celluj34.

Thanks Joe for the inspiration!

v0.18.0

18 Dec 21:19
Compare
Choose a tag to compare

🆕 Added SkipDistributedCache option

After some requests by the community, a new entry option has been added to skip the distributed cache only in specific calls, in a very granular way.

See here for more.

🆕 Added SkipDistributedCacheReadWhenStale option

It is now possible to skip distributed cache reads when the memory entry was stale: this will lead to a perf boost when the 2nd layer is not actually a distributed cache but just an out-of-process cache, like in mobile apps, standalone apps, games and more.

See here for more.

🐞 Better MemoryPack support for .NET 7

Thanks to an issue opened by @RMcD , it has been discovered that MemoryPack has a quite strange and non-standard way to handle transitive dependencies + code generation regarding .NET Standard 2.1 and .NET 7.
After having opened an issue on its repo + some back and forth with its author (thanks to @neuecc for your openness and support!), a solution has been found. The issue there remains, but at least now the integration between FusionCache and MemoryPack is good to go, even on .NET 7!

See here for more.

📢 Changed EnableBackplaneNotifications option to (inverted) SkipBackplaneNotifications

A small rename so that now everything is more aligned and intuitive.

See here for more.

📕 Better docs

Augmented some online docs and inline XML docs, for a better experience while coding.

v0.17.0

04 Dec 20:39
Compare
Choose a tag to compare

🆕 Added MemoryPack support

A new serializer is now available in its own package, to support the new MemoryPack serialization format.

It is based on the amazing work by @neuecc , and this new serializer seems to be already the fastest serializer in the .NET space.

Thanks for your hard work Yoshifumi!

↩️ Backplane auto-recovery now enabled by default

After a couple of releases where it was disabled by default, the initial response in real-world projects has been positive: therefore I decided to enable the auto-recovery feature by default for everyone 🎉

PS: of course you can always turn it off in case you are having problems.

v0.16.0

12 Nov 18:13
Compare
Choose a tag to compare

🆕 Added Protobuf support

A new serializer is now available in its own package, to support the Protobuf serialization format.

It is based on of the most used Protobuf serializers on .NET: protobuf-net (repo here) by @mgravell : thanks for your hard work!

🐞 Added some [DebuggerDisplay] usages

Some class have been decorated with the [DebuggerDisplay] attribute, for a better debugging experience.

💪 Better nullability annotations

Some methods and properties have been decorated even better with nullability annotations, so that static flow analysis can help us catch even more potential NREs (null reference exceptions).

🐵 Chaos may also mean typos

I never noticed that and, since it is only used internally, nobody really paid any attention to that but the community user @luizhtm was spot on in noticing a typo in the Fusio(n)CacheChaosUtils utility class: a missing "n"!

Now there's the correct one with the right name, but temporarily the old one also remains: the entire class and every method inside has been marked as [Obsolete] with an explanation of the issue and how to correct any reference.

Thanks again @luizhtm !

📕 Xml Docs

Added a couple more helpful descriptions.

v0.15.0

26 Oct 10:33
Compare
Choose a tag to compare

🆕 Added MessagePack support

A new serializer is now available in its own package, to support the MessagePack serialization format.

It is based on the most used one on .NET: MessagePack (repo here) by @neuecc : thanks for your hard work!

🆕 Added ReThrowSerializationExceptions

A new option has been added to better control de/serialization exceptions, and the internal flow has been made better around those potential exceptions.

NOTE: contrary to the already existing ReThrowDistributedCacheExceptions which is disabled by default, this option is enabled by default. The rationale is that, while an error while talking to the distributed cache may be transient (because the distributed cache is temporarily down, there's a network error, etc), de/serialization should either always work or not, and typically any error is because of an unsupported data type or a missing configuration, and that is something that we should know as soon as possible and not pretend like it can magically go away later with a retry (like, instead, a transient distributed cache error instead).

🐵 new ChaosSerializer

A new ChaosSerializer has been added (in the ZiggyCreatures.FusionCache.Chaos package) to better handle fail scenarios during de/serialization.

📕 Xml Docs

Fixed some typos and added a couple more helpful descriptions.

v0.14.0

18 Oct 15:08
Compare
Choose a tag to compare

↩️ Backplane auto-recovery (experimental)

FusionCache now has a backplane auto-recovery feature!

It has been added to automatically recover from transient errors in the backplane by keeping a local queue of the notifications that have not been sent successfully. These notifications will be automatically retried as soon as the backplane will become available again, without having to do anything.

It also handles common edge cases, like out of order notifications, and it can also be limited in size to avoid too consuming too much memory, with a sensible heuristic about which notifications to keep.

🧪 NOTE: for now the feature is experimental, and must be manually enabled via the new EnableBackplaneAutoRecovery option.

More info here.

🐵 Chaos-related split

The chaos-related utilities and components, like ChaosDistributedCache and ChaosBackplane, have been moved to a separate project (ZiggyCreatures.FusionCache.Chaos).

This should also slightly reduce dependencies and code size of the main package.

📕 Xml Docs

Added links to the related online documentation in the xml docs for most options, and fixed some typos.

📕 Docs

Added a page about Logging.

Added a chapter about the lock timeout option in the Cache Stampede page.

Added a chapter about notifications behaviour in the Backplane page.

Added a chapter about auto-recovery in the Backplane page.

⚠ Removal of [Obsolete] members

Some members marked as [Obsolete] from a very very long time have been finally removed to clean up the code.

v0.13.0

14 Aug 19:25
Compare
Choose a tag to compare

⏳ Better inferred local expiration

A member of the community (@yzhoholiev , thanks!) noticed that the local (memory cache) expiration, when coming from the distributed cache, was not good enough: with this fix the inferred memory cache expiration in those situations is more precise.
In some scenario a little bit more memory may be used with the distributed cache (eg: when not using fail-safe, otherwise it stays the same) but that should not be very frequent and the additional memory should reasonably not be a problem.

See here for more.

v0.12.0

19 Jul 08:51
Compare
Choose a tag to compare

🆕 Added DistributedCacheDuration

Added a new entry option DistributedCacheDuration (as a nullable TimeSpan).
This serves as an optional specific duration for the distributed cache (if you are using one) to allow custom overrides of the "main" duration: in this way it is now possible for example to specify a duration in the memory cache of 1 min and a duration in the distributed cache of, say, 1 hour.
In theory this is useless if you are using a backplane but, in case you prefer not to or cannot for some reason, this would mitigate the synchronization problems you may encounter in a multi-node scenario.

See here for more.

🔗 Added SourceLink support

FusionCache now supports SourceLink, which should make your debugging experience easier.

See here for more.

🛡 Added Deterministic Builds support

FusionCache now supports Deterministic Builds, which is a nice addition.

See here for more.

⚠ Removal of a Duplicate() method override

The override removed has been marked [Obsolete] for a very very long time and hopefully nobody should've been using it.

v0.11.1

15 Jul 16:38
Compare
Choose a tag to compare

⏱ Rollback of: use soft timeout if failSafeDefaultValue provided

A decision has been made to temporarily rollback a change made in v0.11.0.

To see why take a look at this comment.

The main reason is to avoid unwanted surprises for existing users, who could have suddenly started to receive sub-optimal values during a first call.

Discussion are ongoing on how to better handle this scenario.

v0.11.0

12 Jul 22:32
Compare
Choose a tag to compare

This release includes a lot of small features, changes and fixes.

☎️ Better GetOrSet events

In a previous release there has been a small regression in the events emitted during a GetOrSet call: now it has been fixed.

See #49

⏱ Use soft timeout if failSafeDefaultValue provided

Historically the soft timeout, if specified, has been used only when there was a fallback value in the form of an already expired cache entry.
Sadly, after having introduced the failSafeDefaultValue param, that has not been used to enable the soft timeout.
Now this is resolved thanks to @alexmaek , who also made their first contribution!

See #67

Note
This feature has been rolled back in v0.11.1 release because it was not the right move. See the pull request above for more!

💣 Optional re-throwing of distributed cache exceptions

Following a community request, it is now possible to enable re-throwing of distributed cache exceptions, if you feel like it.
This is done via the new ReThrowDistributedCacheExceptions option on the FusionCacheEntryOptions object.

See #34

📢 Better backplane timeouts handling

Now synthetic timeouts are handled in a more specific way, and there's a new BackplaneSyntheticTimeoutsLogLevel option in the FusionCacheEntryOptions object.

📢 Better backplane error handling

The internal flow on backplane exceptions is now better, to let the (optional) circuit breaker do its job more easily.

🎉 New Contributors