IAFSearch(T).CacheTimeout Property
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
The timeout to clean up the cached search in the server if it has not been used.
Namespace: OSIsoft.AF.Search
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
TimeSpan CacheTimeout { get; set; }
Property CacheTimeout As TimeSpan Get Set Dim instance As IAFSearch Dim value As TimeSpan value = instance.CacheTimeout instance.CacheTimeout = value
property TimeSpan CacheTimeout { TimeSpan get (); void set (TimeSpan value); }
abstract CacheTimeout : TimeSpan with get, set
Property Value
Type: TimeSpanReturns the timeout to clean up the cached search in the server if it has not been used. Specify a value of TimeSpan.Zero to disable the caching of the search results. The default value is TimeSpan.Zero.
Remarks
This property controls whether the search cache is enabled. If the interval is non-zero (cache is enabled), then this setting controls how long the cached search is kept in the server. If the cached search has not been used in the specified timeout period, then it will be removed from the server. Negative values are handled the same as a zero timespan.
If you will only be getting items from the first page, then it is best to leave the cache disabled. If you will be paging through several pages of items, then it is best to enable the cache by setting this property to a value larger than you expect to be using the search.