MSDN 文档没有详细解释它的用途。
由于它是可选的,我几乎假设它类似于某种元数据。
我现在如何看待它,我想用它来为特定用户指定缓存,例如:
new CacheItem(key: "keyName", value: objectData, regionName: "userName")
CacheItem 类的 regionName 属性的职责是什么?它有什么用?
最佳答案
来自 Caching Application Data by Using Multiple Cache Objects in an ASP.NET Application ( archive )
The custom class demonstrates how you would store the cached data in a named region in memory. The built-in memory cache object does not support the concept of regions but it is used in this blog to demonstrate how you would implement regions in a custom cache class. A cache region is a partition in memory that is reserved for storing one or more cache objects. A cache region helps organize cache objects in memory.
(我的重点)
关于c# - CacheItem regionName 属性责任/用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8825783/