Removing specific items from Cache (ASP.NET)

前端 未结 5 803
执念已碎
执念已碎 2021-02-14 02:07

I am adding a bunch of items to the ASP.NET cache with a specific prefix. I\'d like to be able to iterate over the cache and remove those items.

The way I\'ve tried to d

5条回答
  •  礼貌的吻别
    2021-02-14 02:34

    For the cache clean up , I assume you need to run it manually when you notice there are too many cache items. Using MS lib cache block , it can do this work for you automatically. In the cachingConfiguration; you can set the property maximumElementsInCacheBeforeScavenging; once the number of cache items are over the limit then cache manager will clean out the cache automatically.

提交回复
热议问题