onCacheHit method

  1. @override
void onCacheHit(
  1. Hit hitToBeCached
)
override

Implementation

@override
void onCacheHit(Hit hitToBeCached) {
  // Before cache the hit we save also the date creation
  var bodyToCache = hitToBeCached.bodyTrack;
  if (hitToBeCached.createdAt != null) {
    bodyToCache.addEntries(
        {"createdAt": hitToBeCached.createdAt.toString()}.entries);
  }
  // Cache hits
  fsCacheHit?.cacheHits({hitToBeCached.id: bodyToCache});
}