getExpiryForUpdate method

  1. @override
Duration getExpiryForUpdate()
override

Gets the Duration before an updated CacheEntry is considered expired.

This method is called by the caching implementation after a CacheEntry is updated to determine the Duration before the updated entry expires. If a Duration.zero is returned a CacheEntry is considered immediately expired. Returning null will result in no change to the previously understood expiry Duration.

Returns the new Duration before an updated entry expires

Implementation

@override
Duration getExpiryForUpdate() {
  // Updating a cache entry resets the duration.
  return _expiryDuration;
}