3

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

Community
  • 1
  • 1
TyCobb
  • 8,909
  • 1
  • 33
  • 53

1 Answers1

4

Default expiration is introduced in NCache 4.6. Open Source version is 4.4 right now. The open source will be updated soon enough. But here is what you get in the latest Enterprise edition (NCache Manager).

NCache Default expiration

You can specify two defaults and choose if required when adding keys.

Basit Anwer
  • 6,742
  • 7
  • 45
  • 88
  • 2
    Thanks for the information. In this scenario, what is the difference between absolute and sliding? I had assumed based on the signature of the `Add` that Absolute was "expire after this date" and Sliding was "expire after `x` number of hours or minutes". Or am I mistaken on what Absolute and Sliding actual means? – TyCobb Feb 04 '16 at 17:01
  • 1
    [Alachisoft NCache Expiration Documentation](http://www.alachisoft.com/resources/docs/ncache/help/expirations-overview.html?mw=MjQw&st=MQ==&sct=NTE=&ms=QwAAAgAAEAAgAAACAQgQAQI=) – Basit Anwer Feb 06 '16 at 16:26
  • 1
    Fell free to ask any question. I'll be happy to help – Basit Anwer Feb 08 '16 at 04:12