public static function invalidateCache($imageFile) {
    if (strlen($imageFile) > 0) {
      $imageFile = URIUtil::makeRelative($imageFile, self::getMediaRootRelative());
      $fixedFile = FileUtil::fixFilename($imageFile);

      // get file name and cache directory
      $baseName = FileUtil::basename($imageFile);
      $directory = self::getCacheDir($imageFile);

      // delete matches of the form ([0-9]+)-$fixedFile
      if (is_dir($directory)) {
        foreach (FileUtil::getFiles($directory) as $file) {
          $matches = [];
          if (preg_match('/^([0-9]+)-/', $file, $matches) && $matches[1].'-'.$baseName === $file) {
            unlink($directory.$file);
          }
        }
      }
    }
  }