I am not 100%, I've trying accessing the MemoryCache from different projects in the same server and no luck. But there are other Cache functions that will do that.
@@intcoder Thanks for the input. What do you mean by cache func? Which cache func handle in multiple servers? As per my understanding. When we use MemoryCache for multiple servers we had to use sticky session to ensure that requests from a client all go to the same server. OR else we need to go for distributed cache solution. Sticky session does not allow to utilize max scale out performance on the contrary. Quite complex topic if we dig deeper into. Non-sticky sessions in a web farm require a distributed cache like Redis. In real life, If Cache objects are too big , I think its better to use memory cache. If cache object is small we can go for distributed cache system like Redis. Reading from Redis is again a network call and it consume time. Reading in memory should be faster.
This is exactly what i wanted to do in my project. Thank you so much for your tutorial!!!!!!
Exactly what I was looking for. Thank you and God bless you. Keep up the best work
Glad it helped
Why would you do that with a static class? Like, DI exists for a reason...
There are multiple ways this can be done. I've used static class so we can access it from anywhere in the app.
nice walk through, but I'm unsure about using a static class for this. Shouldn't you use it as a dependency injection?
This was just a quick and easy way to demonstrate the use of cache everywhere. There are many other ways to implement it.
please Try and make the font bigger in your next videos. thank you for this.
thanks for the feedback!
Can we use memoryCache for scalling out servers? More than one app server?
I am not 100%, I've trying accessing the MemoryCache from different projects in the same server and no luck. But there are other Cache functions that will do that.
@@intcoder Thanks for the input.
What do you mean by cache func? Which cache func handle in multiple servers?
As per my understanding.
When we use MemoryCache for multiple servers we had to use sticky session to ensure that requests from a client all go to the same server.
OR else we need to go for distributed cache solution. Sticky session does not allow to utilize max scale out performance on the contrary.
Quite complex topic if we dig deeper into.
Non-sticky sessions in a web farm require a distributed cache like Redis.
In real life, If Cache objects are too big , I think its better to use memory cache. If cache object is small we can go for distributed cache system like Redis.
Reading from Redis is again a network call and it consume time. Reading in memory should be faster.