ZiggyCreatures / FusionCache

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

[Question] Help designing caching flow #103

Closed celluj34 closed 1 year ago

celluj34 commented 1 year ago

Hello;

I have sort of a complicated (in my head) flow that I need to account for when upgrading from IMemoryCache to IFusionCache. I want to make sure I'm using this library to its fullest and not re-inventing anything that may already exist.

Basically, what we do is cache some data, then only re-pull when expired or data in the database changes. The operation to detect changes is much faster than the actual data pull. If nothing has changed, we keep the data in cache until it expires naturally. We are caching the "last run" datetime so we can get "any changes since ?".

What I'm looking for is, is there a way to extend the lifetime of some cached data based on the result of a different operation?

Edit: It looks like https://github.com/ZiggyCreatures/FusionCache/issues/96 might solve what I'm looking for, let me know if that would fit my scenario.

jodydonetti commented 1 year ago

Hi @celluj34 , sorry for the delay. I somehow missed this and with Christmas + some influenza I'm now getting back to the backlog.

Anyway yeah, I would say #96 is what you should use.

I think a I'll be able to update the status of that issue soon with some news.

celluj34 commented 1 year ago

Ok, great! I'll go ahead and close this. Hoping for good news soon 🤞