Level 3 cache #358
-
Hi all, i know this lib only support 2 layer cache, but i want to add the 3rd layer that use sqlite for caching? Is this possible and if it is, are there any docs about this? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @Jackpieking , the idea is that there are 2 clearly defined levels:
This design allows FusionCache to have a clear behavior, without things like "we have 2 distributed levels, 1 failed, the other didn't: what should we do?" kind of things. This, in turn, allows FusionCache to have features like smart timeouts, auto-recovery, etc. Now, because of this, in theory 3 levels would not be ideal. But. You can create your own impl of Inside of it you need to make the 2 calls to MemoryCache/SQLite or SQLite/Redis, basically an adapter approach. However, you need to decide some things, like:
Having said that, yeah: you can actually do that. I made a quick experiment some time ago, and it worked pretty well: having said that, I did not use it in production, so some extra testing before going live may be necessary. If you try with this approach, please let me know! Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi @Jackpieking , the idea is that there are 2 clearly defined levels:
This design allows FusionCache to have a clear behavior, without things like "we have 2 distributed levels, 1 failed, the other didn't: what should we do?" kind of things. This, in turn, allows FusionCache to have features like smart timeouts, auto-recovery, etc.
Now, because of this, in theory 3 levels would not be ideal.
But.
You can create your own impl of
IDistributedCache
orIMemoryCache
and pass that to FusionCache!Inside of it you need to make …