ClearCache

Document management, Performance, Concurrency

Description

Drops every retained chunk from the stream cache and starts a new cache generation, so completions of fetches that were still in flight cannot repopulate the cleared cache or its counters

When ResetStatistics is True the cumulative hit, miss, eviction, source-read and coalescing counters return to zero, together with the fetched-range history behind the repeated-read counter

Syntax

Delphi

Procedure TByteRangeStream.ClearCache(ResetStatistics: Boolean= True);

Parameters

ResetStatisticsTrue zeroes the cache statistics along with the cached bytes; False discards the cached bytes and keeps the accumulated counters

Remarks

Callers already waiting on a pending fetch still receive their bytes; only the insertion of stale results into the new generation is suppressed

The call is serialized with the cache, so it is safe while other threads are reading

See also

TByteRangeStreamReadAt, TByteRangeStreamAvailability, ClearRangeSourceCache, GetRangeSourceCacheInfo