Is "Expire" broken? #376
-
Hey, @jodydonetti. First of all, thank you for all the effort and care you give to the community! Seems like I need your advice. I am trying to fugure out how to use FusionCache with Redis as a L2 for "cold start". While experimenting with settings I've found that with FailSafe enabled calling Expire immediatelly removes the value from Redis, thus behaving just like Remove. And this is where I get confused... Accorting to docs the Expire "method may be is useful in case we want to threat something as remove, but with the ability to say "better than nothing" in the future, in case of problems (thanks to fail-safe)", but at the same time heredocs in the code for Expire tell us "In the distributed cache (if any), the entry will always be effectively removed". Thus, immediate deletion of the value from L2 cache makes the use of it as "stale" (in case if its factory fails) impossibe. Are we sure there is no bug in Expire logic? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks, really appreciate it!
I see what you mean, let me explain why it is the way it is (and let me know what you think about it). First thing: you are right about the docs, I should make them more clear. Added this to my backlog, thanks! Second: distributed caches in general (and But to do this, FusionCache needs all the info about the entry, and the core problem is that you can call So the idea is that, whn doing an
I think this is the most that can be done without overloading L2 with extra calls or risking out-of-sync updates.
No, I wouldn't say it's bugged, I'd say it tries to do the best in ca with the available underlying L2 features. But I'd like to know from you, now with more insights into why it works the way it works: what do you think? |
Beta Was this translation helpful? Give feedback.
Hi @andriibratanin
Thanks, really appreciate it!