Implementing In-Memory Caching in ASP.NET Core Applications

Поділитися
Вставка
  • Опубліковано 22 кві 2024
  • ►► Master Web API development Best Practices: bit.ly/3TnqoFQ
    ►► Build great web apps in Blazor WebAssembly: bit.ly/437g87T
    ►► Support us on Patreon and get the source code: / codemaze
    In this video, I will talk about the caching basics and how to implement In-Memory Caching to improve performance and response speed in ASP.NET Core Web API applications.
    What is Caching?
    Caching is the technique of storing frequently accessed data at a temporary location for quicker access in the future. This can significantly improve the performance of an application by reducing the time required for connecting with the data source and sending data across the network.
    In-memory caching is the simplest form of cache in which the application stores data in the memory of the web server. This is based on the IMemoryCache interface which represents a cache object stored in the application’s memory.
    FOLLOW US ON SOCIAL MEDIA!
    ►► / marinko-spasojevic
    ►► / codemazeblog
    ►► / codemazeblog

КОМЕНТАРІ • 16

  • @CodeMaze
    @CodeMaze  Місяць тому +1

    Thank you all for watching and for your support.
    ►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM
    ►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33

  • @Tamer_Ali
    @Tamer_Ali 28 днів тому

    Thanks a lot @CodeMaze for talking about Cache Stampede using SemaphoreSlim in In-Memory Caching. I was looking for that topic

    • @CodeMaze
      @CodeMaze  28 днів тому

      Glad it was helpful! Thank you for watching the video.

  • @davood7497
    @davood7497 Місяць тому +1

    Good one !!!

    • @CodeMaze
      @CodeMaze  Місяць тому

      Thank you! Cheers!

  • @curtisdave2858
    @curtisdave2858 Місяць тому

    Thank you for this video, crazy that it was just created yesterday😂. Right timing for me I guess

    • @CodeMaze
      @CodeMaze  Місяць тому +1

      You are most welcome. Thank you too for watching the video. As many would say, there is no wrong time for good stuff :)

  • @Tamer_Ali
    @Tamer_Ali Місяць тому

    Thanks @CodeMaze for the video.
    Are you going to talk about cache stampede?

    • @CodeMaze
      @CodeMaze  Місяць тому

      Thank you too for watching. I will see about that topic. It is interesting for sure, just can be a bit more theoretical as well. Thank you for the suggestion though.

  • @ramasamynagappan7586
    @ramasamynagappan7586 Місяць тому +1

    Great

  • @Tamer_Ali
    @Tamer_Ali 4 дні тому

    I'd like to create a service for caching. should I return ValueTask instead of Task from the methods?
    ValueTask SetAsync(string key, T value, CancellationToken token = default)

    • @CodeMaze
      @CodeMaze  3 дні тому

      Using ValueTaks with caching operations should be recommended but also tested with benchmarks. It doeasn't have to be a faster operation, because that's not the main purpose for ValueTask, but it can definitely reduce memory allocations. We have a great article on that topic: code-maze.com/csharp-task-and-valuetask/, you can find a bit more info there.

    • @Tamer_Ali
      @Tamer_Ali 3 дні тому

      @@CodeMaze I already read it 👍

  • @Galal424
    @Galal424 Місяць тому

    You are the best person
    Thanks 🤍