none
Memory Caching in C# RRS feed

  • Question

  • I know the cache memory speed up the running speed.

    However I have no idea how to implement in C#.

    Can anybody show some sample example in C#?

    Thursday, April 2, 2020 5:26 PM

All replies

  • Hello,

    So those who are willing to assist, please provide a complete description of what you want to achieve, more details are better than less details. 


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, April 2, 2020 7:29 PM
    Moderator
  • Hi Jeff0803,

    Thank you for posting here.

    Please see the following documents and examples to understand the use of caching in C # and ASP.

    Microsoft.Extensions.Caching.Memory Namespace

    System.Runtime.Caching Namespace

    Distributed caching in ASP.NET Core

    Caching

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 3, 2020 3:13 AM
  • Can I get some sample code of any programming language for me to refer?
    Tuesday, April 7, 2020 4:07 AM
  • Can I get some sample code of any programming language for me to refer?
    Caching is done in ASP.NET.  Are you using ASP.NET? Other than that, you can write data out to a database table and read it, write Json data out to a text file and read it and write data out to a XML file and read it as examples of caching data. 
    Tuesday, April 7, 2020 5:35 AM
  • An example of caching data: BufferedStream. In certain case it improves the performance of disk and network operations. Check a complete sample in C#, VB and C++:

    Tuesday, April 7, 2020 6:01 AM
  • Hi Jeff0803,

    The last two links provide examples of C#.

    You can also look at this, a very detailed example.

    Cache in-memory in ASP.NET Core

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 7, 2020 8:56 AM