Data Expiration
NCache supports time-based data invalidation where you can specify the time or interval to expire your cache data. NCache maintains an index for items with time based Expiration. A dedicated thread checks cache data for these expired items periodically after a configurable interval of time called Clean Interval. Clean interval is the periodic interval after which the expired items are removed from the cache. By default, Expiration Clean-Up interval is 15 seconds.
You can manually edit config.ncconf and client.ncconf located at %NCHOME%/config. %NCHOME% is NCache install directory. These files can be edited through any text editor of your choice.
Important
In case you want to update any cache settings please refer to the Update Cache Config section to follow the set of steps.
Specify cleanup interval and Expiration policy through config.ncconf file located at %NCHOME%\config. %NCHOME%
is NCache install directory. In config.ncconf of EACH server specify the <cleanup>
tag in the <cache-settings>
tag.
Configuring Data Expiration
The following example sets default absolute Expiration to true, and its value to 30 seconds.
<cache-config>
<cache-settings ... >
<expiration-policy enabled="True">
<absolute-expiration longer-enabled="False" longer-value="0"/>
<sliding-expiration longer-enabled="False" longer-value="0"/>
</expiration-policy>
<cleanup interval="15sec"/>
</cache-settings>
</cache-config>
enabled: Enables the Expiration policy.
longer-enabled: Specifies whether Longer Expiration is enabled. If true, the value should be provided.
longer-value: If longer-enabled is true, the value should be provided under this tag. If no value is provided here and default-longer is enabled, the default value of 10 seconds will be used.
cleanup-interval
is the periodic interval after which the expired items are removed from the cache. By default, its value is 15 seconds.
For more detail about the Expiration strategies, see the Data Expiration section.
Note
Repeat this step for all server nodes.