ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.65k stars 87 forks source link

[FEATURE] Expire entire cache #178

Closed giulianob closed 6 months ago

giulianob commented 11 months ago

Problem

I have a backplane which pushes updates to the cache. I'd like to expire the entire cache (not remove the items) if the backplane connection is severed.

Solution

Ability to call ExpireAsync on the cache or some way to achieve this.

jodydonetti commented 11 months ago

Hi @giulianob , I'm not sure I understand the scenario you have in mind.

May I ask you to try to explain it a little bit more? Maybe with a concrete example, a step-by-step list like:

Thanks!

giulianob commented 11 months ago

@jodydonetti

The use case is as following:

jodydonetti commented 6 months ago

Hi @giulianob , sorry for the delay but somehow I lost track of this issue.

Anyway, currently there's no ready made solution to cover this particular scenario, and in general it's not possible to completely clear a cache, for various reasons.

If you want to learn more about why this is the case and what other people do think, I suggest to take a look at the issue currently unfolding about the new distributed cache effort going on for .net 9 , it's ful of interesting experiences and ideas.

I'm closing this since, in general, a Clear() method cannot be supported, but if something new comes up I'll gladly reopen it.