v2.4.0
๐ท๏ธ Add StaleTags to factory execution context
Community user @ted-mundy noticed a tricky behavior when using Tagging with stale entries (see next point).
To solve it, I added a new StaleTags property to the factory execution context, so that now it's possible to access both the tags that are being passed to the GetOrSet() call and the existing tags of the stale entry in the cache (if any), like this:
cache.GetOrSet<string>(
"foo",
(ctx, token) => {
// THE TAGS PASSED BELOW ("tag1", "tag2" and "tag3")
ctx.Tags;
// THE TAGS OF THE STALE ENTRY ALREADY IN THE CACHE, IF ANY
ctx.StaleTags;
return "Combo";
},
tags: ["tag1", "tag2", "tag3"]
);
This can be useful even in other scenarios, like applying some custom logic about what to do based on the tags already in the cache.
Nice.
๐ Fix for tags with stale entries
As mentioned above, community user @ted-mundy noticed a tricky behavior when using Tagging with stale entries.
Thanks to the addition of the new StaleTags property, this is now solved for good.
Thanks @ted-mundy !