Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CacheItem regionName property responsibility/uses?

The MSDN documentation doesn't explain in detail what its used for..

Since its optional, I almost assume its like metadata of some sort...

How I look at it right now, I'd like to use it as a way to specify caches for specific users only such as:

new CacheItem(key: "keyName", value: objectData, regionName: "userName")

What is the responsibility of the regionName property of the CacheItem class? What is it used for?

like image 706
Tom Bass Avatar asked Jan 11 '12 19:01

Tom Bass


1 Answers

From Caching Application Data by Using Multiple Cache Objects in an ASP.NET Application

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.

(my emphasis)

like image 154
fiat Avatar answered Sep 28 '22 12:09

fiat