getExpiryForCreation method

  1. @override
Duration getExpiryForCreation()
override

Gets the Duration before a newly created CacheEntry is considered expired.

This method is called by a caching implementation after a CacheEntry is created, but before a CacheEntry is added to a cache, to determine the Duration before an entry expires. If a Duration.zero is returned the new CacheEntry is considered to be already expired and will not be added to the Cache.

Returns the new Duration before a created entry expires

Implementation

@override
Duration getExpiryForCreation() {
  // For newly created entries we use the specified expiry duration
  return _expiryDuration;
}