code: protected function setCommandCache($command)
      {
          if ($this->queryCacheDuration !== null || $this->queryCacheDependency !== null) {
              $duration = $this->queryCacheDuration === true ? null : $this->queryCacheDuration;
              $command->cache($duration, $this->queryCacheDependency);
          }
  
          return $command;
      }
docs: Sets $command cache, if this query has enabled caching.
  
  @param Command $command
  @return Command
  @since 2.0.14