Object cache for C#

前端 未结 9 1399
面向向阳花
面向向阳花 2020-12-07 23:06

I\'m doing a document viewer for some document format. To make it easier, let\'s say this is a PDF viewer, a Desktop application. One requirement for the s

9条回答
  •  时光说笑
    2020-12-07 23:59

    How are you implementing your cache?

    You can use the Cache class from System.Web.Caching, even in non-web applications, and it will purge items on an LRU basis if/when it needs the memory.

    In a non-web application you'll need to use HttpRuntime.Cache to access the Cache instance.

    Note that the documentation states that the Cache class isn't intended to be used outside of ASP.NET, although it's always worked for me. (I've never relied on it in any mission-critical app though.)

提交回复
热议问题