How To Cache ASP.NET Core Web API

Поділитися
Вставка
  • Опубліковано 29 вер 2024

КОМЕНТАРІ • 12

  • @thanasakis61
    @thanasakis61 2 роки тому +1

    This is exactly what i wanted to do in my project. Thank you so much for your tutorial!!!!!!

  • @firefalcon03
    @firefalcon03 2 роки тому

    Exactly what I was looking for. Thank you and God bless you. Keep up the best work

  • @promant6458
    @promant6458 4 місяці тому

    Why would you do that with a static class? Like, DI exists for a reason...

    • @intcoder
      @intcoder  4 місяці тому

      There are multiple ways this can be done. I've used static class so we can access it from anywhere in the app.

  • @Mo-ef9yt
    @Mo-ef9yt 2 роки тому +1

    nice walk through, but I'm unsure about using a static class for this. Shouldn't you use it as a dependency injection?

    • @intcoder
      @intcoder  2 роки тому

      This was just a quick and easy way to demonstrate the use of cache everywhere. There are many other ways to implement it.

  • @abobonickname5696
    @abobonickname5696 2 роки тому +1

    please Try and make the font bigger in your next videos. thank you for this.

    • @intcoder
      @intcoder  2 роки тому

      thanks for the feedback!

  • @DarshanaHashendra
    @DarshanaHashendra 2 роки тому

    Can we use memoryCache for scalling out servers? More than one app server?

    • @intcoder
      @intcoder  2 роки тому

      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.

    • @DarshanaHashendra
      @DarshanaHashendra 2 роки тому

      @@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.