An item descriptor can limit the lifetime of cached items in two ways:

Force refreshes of items in the item and query caches

An item descriptor’s item-expire-timeout and query-expire-timeout attributes specify how long items can stay in the item and query caches, respectively, before they are invalidated. For example, if the item-expire-timeout for a cached item is set to 60000 (milliseconds), its data becomes stale after 60 seconds; and the item must be reloaded from the database when it is next accessed.

The following item-descriptor tag sets attributes item-expire-timeout and query-expire-timeout to 180 seconds:

<item-descriptor name="order" cache-mode="simple"
      item-expire-timeout="180000"
      query-expire-timeout="180000">
...
</item-descriptor>
Refresh unused item cache entries

An item cache entry is regarded as stale if it is not accessed within the time span specified in its item-cache-timeout attribute. A stale item must be reloaded from the database the next time it is accessed. If set to 0 (the default), the item can remain indefinitely in the item cache until it is otherwise invalidated.

The following item-descriptor tag sets attribute item-cache-timeout to 180 seconds:

<item-descriptor name="order" cache-mode="simple"
                 item-cache-timeout="180000">
...
</item-descriptor>

You can use cache timeout attributes together with simple caching to control the behavior of repository caches. Cache timeout attributes are useful for caching user data associated with a particular session. A user session is typically handled by a single Oracle ATG Web Commerce server for as long as the session lasts. If the user session expires and the user moves to another Oracle ATG Web Commerce server, the cached data expires before the user can log back on to a server that might have previously cached stale data for that user.