I am vetting out NCache as we look to move away from AppFabric. Currently, I am just using the Open Source edition and its been fairly straight forward. However, I cannot find out how to designate a default timeout for the items added to a cache.
I understand I can explicitly state when an item expires either using Absolute or Sliding expirations, but I am looking for a way to set the default in the cache config. We could do this with AppFabric and only explicitly set the expiration when it needed to differ.
For the most part I am using the default cache configuration that was installed, but I tried to add in a <expiration>
like I saw for ASP.NET applications that used the web.config and ncContentOptimization
from this question: Alachisoft Ncache configuration issues.
Below is my cache-settings from the server's config.ncconf
.
<cache-config config-id="0">
<cache-settings cache-name="myCache" alias="" inproc="False" last-modified="">
<logging enable-logs="True" trace-errors="True" trace-notices="False" trace-warnings="False" trace-debug="False" log-path=""/>
<performance-counters enable-counters="True" snmp-port="0"/>
<cache-notifications item-remove="False" item-add="False" item-update="False" cache-clear="False"/>
<cleanup interval="15sec"/>
<storage type="heap" cache-size="1024mb"/>
<eviction-policy enabled-evication="True" default-priority="normal" policy="priority" eviction-ratio="5%"/>
<cache-topology topology="local-cache"/>
<expiration type="Sliding" duration="1" />
</cache-settings>
</cache-config>
Is it even possible to configure a default expiration or should I be looking at the