Clearing L1 cache on Redis disconnect and bypassing cache layers during downtime #542
heldersantovisma
started this conversation in
General
Replies: 2 comments
-
|
Hi @heldersantovisma , thanks for your words! Meanwhile, if you haven't already, may I suggest you to take a look at the L1+L2 and backplane docs? I think some of the info may be there. Also the Auto-Recovery docs in particular, here. Hope this helps, see you next week. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hi @heldersantovisma , did you have time to take a look at the docs, Auto-Recovery, etc? Any thought or news on this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
First of all, thank you for this excellent project - it addresses distributed caching challenges I've wanted to tackle for a while. Great work!
Context:
I'm using a L1 (memory) + L2 (Redis) + Backplane (Redis) configuration where L2 and backplane share the same Redis instance.
Problem:
I'm concerned about a scenario where Redis becomes unavailable or the service loses connectivity. When this happens, L1 will continue serving potentially stale data even if the actual value has changed elsewhere.
What I'm trying to achieve:
When Redis disconnects, I want to:
Clear all L1 entries
Bypass both L1 and L2 cache layers while Redis is unavailable
Execute the factory function directly for each request during the outage
Resume normal L1+L2 caching once Redis reconnects
I'm exploring using the Redis multiplexer to detect disconnects/reconnects and trigger this behavior. Is this approach feasible with FusionCache? Can I dynamically bypass the cache layers during Redis downtime and automatically resume caching when connectivity is restored?
Side question:
I've attempted using Clear() with allowFailSafe = true and the following options:
FusionCacheEntryOptions {
SkipDistributedCacheRead = true,
SkipDistributedCacheReadWhenStale = true,
SkipDistributedCacheWrite = true,
SkipBackplaneNotifications = true
}
My expectation was to clear only L1, but I'm observing that L2 entries are also being removed from Redis (confirmed by checking Redis after a GetOrDefaultAsync call). Is this expected behavior, or am I misconfiguring something?
Beta Was this translation helpful? Give feedback.
All reactions