moozzyk / EFCache

Second Level Cache for Entity Framework 6.1
Microsoft Public License
100 stars 22 forks source link

How to bypass the cache if provider server is down and cache throws exception? #6

Open tafs7 opened 7 years ago

tafs7 commented 7 years ago

Is there a way to bypass the cache when the underlying cache provider is down? For example, using a remote Redis cache, if the server is not available, a call to the cache will throw an exception, which will bubble up to the caller of the DB code.

Is there a hook or a customization that we can put in place that bypasses the cache altogether on exception, so that caller doesn't have to know there was a transient error, but we can still log the exception for ops monitoring? thanks!

moozzyk commented 7 years ago

I guess the question is where it is supposed to be implemented/configured. Should EFCache always catch exceptions from cache provider and do the full read or is it on the provider to handle this kind of situations.

tony-asu commented 4 months ago

How would you feel about setting for The number of seconds to wait after an exception before trying the cache again?

moozzyk commented 4 months ago

At this point I am not planning on implementing any changes in this library except for fixing security issues.