maxCachedResponses property

int get maxCachedResponses

The maximum number of responses cached by this connection.

Reducing the value evicts the oldest entries first. Zero disables the cache. The default is 512.

Implementation

int get maxCachedResponses => _responseCache.maxEntries;
set maxCachedResponses (int value)

Implementation

set maxCachedResponses(int value) {
  RangeError.checkNotNegative(value, 'maxCachedResponses');
  while (_responseCache._entries.length > value) {
    _responseCache._entries.remove(_responseCache._entries.keys.first);
  }
  _responseCache.maxEntries = value;
}