Controlling CacheItemPolicy properties from your config file - is it possible?


with reference system.runtime.caching class in .net 4.0 seems possible set limited number of things in configuration file wit:

  • name
  • polling interval
  • the amount of memory that cache allowed consume
  • the percentage of memory needs hit before cache scavenged

a sample section shown below:

<system.runtime.caching> <memorycache> <namedcaches> <add name="nameofmycache" pollinginterval="00:05:00" cachememorylimitmegabytes="0" physicalmemorylimitpercentage="0"/> </namedcaches> </memorycache> </system.runtime.caching>

however appears none of useful items (imho!) controllable config file. these options in cacheitempolicy class such absoluteexpiration, slidingexpiration , priority (i can understand how callback functions aren't exposed although expect see options in event these called)

the question is, possible config file without going away , rolling own custom sections?


sunt ludi et ioci dum aliquis oculo nocet.

hi noonand,

welcome msdn forum.

so far, think not easy in .net 4.0.

please take @ documentation: http://msdn.microsoft.com/en-us/library/dd941872.aspx 

there 4 attributes have mentioned, , no more. 

absoluteexpiration, slidingexpiration , priority designed cacheitempolicy object can related memorycache object. 

one cache object can dynamically bind different cache policy object. 

and can report request connect site: http://connect.microsoft.com/visualstudio/ to let microsoft knows. 

best regards,


mike feng
msdn community support | feedback us
please remember mark replies answers if , unmark them if provide no help.



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

How to Share webservice object to all user

Catalog Staging