Comments (9)
Hi @yzhoholiev , I just pushed a change that should fix what you reported.
A couple of notes regarding the change:
- now, when creating a memory cache entry from a distributed cache entry, the logical expiration will be used if there's metadata, even if fail-safe is not enabled for that specific call
- to allow for the logical expiration to be there even when fail-safe is not enabled, FusionCache now always includes the metadata in the distributed cache entry
- if specified, jittering will still be added locally on top of the logical expiration from the distributed cache, so to respect that settings (which btw is disabled by default)
- this new version may consume a little bit more memory than the previous ones since it always include the metadata, but only in the cases where fail-safe was not enabled (because previously, if fail-safe was enabled, metadata was being included already), and all in all I think this is not a big deal
This allows us to have a more precise local expiration in case an entry is coming from the distributed cache, on top of not consuming more memory in case there's no distributed cache involved.
Please let me know what you think: in case everything looks good also to you, I'll push a new release asap.
Thanks!
from fusioncache.
@jodydonetti sorry for the uncertainty. We will spend some time testing the implementation.
from fusioncache.
The fix seems to be working!
from fusioncache.
Awesome, thanks for testing it!
I'll release a new version in the next days, will update you.
from fusioncache.
Hey @yzhoholiev , I just released v0.13.0 which contains this fix, hope this helps.
Closing this issue.
from fusioncache.
Hi @yzhoholiev , and thanks for considering FusionCache!
Honestly I think you probably have a point here, but I also remember reasoning about this aspect back at the time when I did it.
Anyway let me look a little bit more into this in the next few days, and I will come back to you.
Thanks!
from fusioncache.
Hi @yzhoholiev , sorry for the delay but after 2 years covid finally got me 🤒.
Anyway I've looked more into this, and here are some random things I'm thinking about:
- currently FusionCache already saves the
LogicalExpiration
into the metadata - I may be able to use that
LogicalExpiration
as the expiration for the local memory cache, so to have everything aligned (+/- some jittering, if configured) - the metadata though is (currently) saved only if fail-safe is enabled, to not waste resources (memory + bandwidth)
- therefore to proceed this way I would be forced to always save the metadata (consuming more resources)
- that would ok to have a better, more precise behavior
- also I can limit this change only for the distributed cache (so that the expiration will flow through different nodes) and not for the memory cache
The thing is not super straightforward when considering all possibilities, since it involves all possible cases of entries that are from memory or distributed, that are fresh or stale, that are with or without fail-safe enabled, etc...
I'll take some more time to marinate all these thoughts, experiment with some changes and will come back to you as soon as possible.
from fusioncache.
Hi @yzhoholiev , I just saw your 👍 reaction: just so I know what to do, the thumbs up was like "ok I'll take a look at that and let you know" (so I'll wait) or "I looked at that and it is good to me" (so I move on and release a new version)?
Thanks!
from fusioncache.
Got it, thanks!
from fusioncache.
Related Issues (20)
- [FEATURE] 🪞 Remove all usage of reflection HOT 6
- [FEATURE] Better detection of incoherent `CacheName`s options HOT 4
- [QUESTION] Can I use FusionCache only for getting data from a 2nd level (distributed) without InMemory part? HOT 5
- [FEATURE] 📢 Add `IgnoreIncomingBackplaneNotifications` options HOT 2
- [FEATURE] Improve nullable for GetOrSet with non-null factory HOT 8
- Explicitly tell the Factory that it failed HOT 9
- [FEATURE] Combination of eager refresh with distributed cache duration. HOT 5
- [FEATURE] Add a method for list all caches in IFusionCacheProvider (Ex: for dispose purposes) HOT 4
- Possibility of creation of a count variable in distributed cache HOT 2
- [FEATURE] Post factory executed event with possibility to change the cache settings before it be inserted in cache HOT 3
- Syncing different cloud instances HOT 4
- [BUG] Value is stored for longer than FailSafeMaxDuration HOT 7
- [BUG] AllowBackgroundDistributedCacheOperations serialization and cache operations seem to be happening in the foreground HOT 3
- best way to store FusionCacheEntryOptions in iConfiguration HOT 3
- Nullable `Size` option HOT 3
- [BUG] Deadlock caused by cancellation of eager refresh HOT 8
- [BUG] Slow Performance of FusionCache compared to Microsoft.Extensions.Caching.Memory.MemoryCache HOT 4
- [BUG] FailSafe max duration is somehow ignored HOT 7
- [FEATURE] Optimise dependencies by adding TFM HOT 9
- 💡 Add this project to awesome-italia-opensource HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusioncache.