Home


Priority

Use the priority sub-element to specify the priority of a cache entry in a cache. The priority weighting is used by the least recently used (LRU) algorithm of the cache to decide which entries to remove from the cache if the cache runs out of storage space. For example,

<priority>value</priority>

Value is a positive integer between 1 and 255, inclusive.

Example | -27 keeps the cache entry in the cache for a minimum of 35 seconds and a maximum of 180 seconds. If the cache entry is accessed within each 35 second inactivity period, the inactivity period is extended for another 35 seconds. However, because the timeout element is also configured, the cache entry is always invalidated after 180 seconds. If the cache entry is not accessed within the 35 second period, the entry is removed from the cache.

Example 6-27 inactivity and timeout usage - Sample 1

<cache-id>
  <component id="timeout" type="parameter">
    <required>true</required>
  </component>
  <timeout>180</timeout>
  <inactivity>35</inactivity>
  <priority>1</priority>
</cache-id>

Example | -28 keeps the cache entry in the cache for a minimum of 600 seconds. If the cache entry is accessed within each 600 second period, the inactivity period is extended for another 600 seconds. If the cache entry is not accessed within the 600 second period, the cache entry is removed from the cache.

Example 6-28 Another inactivity and timeout - Sample 2

<cache-id>
  <component id="timeout" type="parameter">
    <required>true</required>
  </component>
  <inactivity>600</inactivity>
  <priority>1</priority>
</cache-id>

In Example | -29 the value for inactivity has no meaning because the timeout period is less than the inactivity period. The cache entry is always invalidated after 180 seconds, no matter how often the cache entry is accessed.

Example 6-29 Timeout value < inactivity period

<cache-id>
  <component id="timeout" type="parameter">
    <required>true</required>
  </component>
  <timeout>180</timeout>
  <inactivity>600</inactivity>
  <priority>1</priority>

</cache-id>

+

Search Tips   |   Advanced Search