Update dependency ZiggyCreatures.FusionCache to 1.4.1 #293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.2.0
->1.4.1
Release Notes
ZiggyCreatures/FusionCache (ZiggyCreatures.FusionCache)
v1.4.1
This is a small version, just to update some transitive packages with security vulnerabilities.
The affected transitive packages are:
System.Text.Json
MessagePack
Microsoft.Extensions.Caching.Memory
To that to update
Microsoft.Extensions.Caching.Memory
, an update forSystem.Diagnostics.DiagnosticSource
was also needed.This is all.
PS: if you have some time, please read the Tagging proposal (eg: evict by tag + clear), which is planned for
v2.0
. This will be one of the biggest and most important features of FusionCache ever. Any help is welcome!v1.4.0
🚀 Add support for RecyclableMemoryStream to serializers (docs)
It is now possible to use
RecyclableMemoryStream
s with some of the supported serializers.It's opt-in, meaning totally optional, and it's possible to use the default configuration or to specify one in the constructor, for maximum control and to fine-tune it however we want.
Thanks @viniciusvarzea for the suggestion!
See here for the original issue.
🔭 Better observability for GET operations (docs)
Community user @dotTrench noticed that when using OpenTelemetry, GET activities (
TryGet
,GetOrDefault
, etc) were not including a useful bit of information: the hit/miss status.While adding support for it via an extra tag, it was also noticed that it was not including another useful bit of information: the stale/fresh status.
Now this is solved, thanks to 2 new tags.
See here for the original issue.
💣 Throw specific exception when factory fails without fail-safe (docs)
Since v1.3.0 it's possible to trigger a factory fail without throwing an exception, so that fail-safe can kick in and do its thing.
But what happens if fail-safe is not enabled or if there's no stale value to fall back to?
Previously a plain
Exception
was being thrown, but that is hardly a best practice: now a more specific exception type has been created and will be thrown instead, namelyFusionCacheFactoryException
.See here for the original issue.
🛑 Add cancellation support to serializers (docs)
Previously serializers did not support cancellation: now this is supported, via the standard
CancellationToken
s.Thanks @b-c-lucas for noticing it!
See here for the original issue.
🚀 Better perf for FusionCacheProvider (docs)
Community user @MarkCiliaVincenti contributed with a PR that improved the performance of FusionCacheProvider, used with Named Caches, thanks to the use of FrozenDictionary.
See here for the original PR.
🐞 Respect the
Size
of an entry loaded in L1 from L2 (docs)Community user @Amberg noticed that when the
MemoryCache
(L1) passed to FusionCache had aSizeLimit
configured, and an entry wasbeing saved with aSize
specified, that was not used when automatically getting the same entry from another node via the distributed cache, causing an issue.Now this is solved, in 2 different scenarios:
See here for the original issue.
✅ Way better tests
As always some tests have been added for each new feature.
On top of that though, the testes have been changed to make them even more resilient to microscopic differences between different runtimes, OSs, etc: most of the problems were related to this almost unknown behaviour.
This helped make the entire test suite even more stable and with a predictable outcome, both locally and on GitHub actions.
Overall, FusionCache currently has around 750 tests, including combinatorial params.
See here for some juicy details.
📕 Docs
Updated some docs with the latest new things.
v1.3.0
♊ Auto-Clone (docs)
In general is never a good idea to mutate data retrieved from the cache: it should always be considered immutable/readonly.
To see why, read more in the docs.
Not all the scenarios where mutating a piece of data we got from the cache are necessarily wrong though, as users may have a particular use case where that may be needed, and ideally they should be abe to do that in an easy (and optimized!) way, by following the tried and true "it just works" mindset.
With Auto-Clone this is now possible.
A couple of details:
EnableAutoClone
option)Thanks to community users @JarrodOsborne and @kzkzg !
See here for the original issue.
💣 Fail-Safe Without Exceptions (docs)
Currently the way to activate fail-safe is for a factory to throw an exception.
This makes sense, since the whole point of fail-safe is to protect us when an error occurs while executing a factory.
But there may be other ways to do it, for example by using a variation of the Result Pattern or similar approaches, in which throwing an exception is not necessary.
This is now possible thanks to the new
Fail(...)
method on theFusionCacheFactoryExecutionContext<TValue>
type, which we can access when executing a factory.A quick example:
Thanks to community user @chrisbbe that noticed it!
See here for the original issue.
🧙♂️ Adaptive Caching on errors (docs)
Previously it was not possible to use adaptive caching when an error occurred during a factory execution.
This was usually not a big issue, but it left a particular edge case not fully uported: selectively enabling/disabling fail-safe on errors.
Now this is possible, in the usual unified way.
Thanks to community user @cmeyertons for spotting it, and for creating the PR that solved it.
See here for the original issue.
📦 More granular (and less) dependencies with multi-targeting
Thanks to a note by community user @thompson-tomo FusionCache now multi-targets different .NET vesions.
This was not needed per-se, but by doing it FusionCache can now have less dependencies for some TFMs.
See here for the original issue.
🚀 Better perf for FusionCacheProvider (docs)
Community user @0xced contributed with a PR that improved the performance of FusionCacheProvider, used with Named Caches.
See here for the original PR.
Communicty user @dependabot (😅) noticed CVE-2024-30105 and promptly bumped the referenced version of the System.Text.Json package.
Note that this is only related to the package ZiggyCreatures.FusionCache.Serialization.SystemTextJson.
✅ Better tests
Some tests have been added for each new feature, and overall better snapshot tests.
📕 Docs
Updated some docs with the latest new things.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.