code: private function getModTimes(MessageInterface $request, ImageResource $resource)
      {
          $time = time();
          return [
              $time,
              (new DateTime)->setTimestamp($modDate = $resource->getLastModified()),
              strtotime($request->getHeaderLine('if-modified-since')) ?: $time,
              $modDate
          ];
      }
docs: getModTimes
  
  @param MessageInterface $request
  @param ImageResource $resource
  
  @return array