How to get Drupal cache key?
The itok is defined in ImageStyle@getPathToken entity when building the URL (ImageStyle@buildUrl):

  /**
   * {@inheritdoc}
   */
  public function getPathToken($uri) {
    // Return the first 8 characters.
    return substr(Crypt::hmacBase64($this-&gt;id() . ':' . $this-&gt;addExtension($uri), $this-&gt;getPrivateKey() . $this-&gt;getHashSalt()), 0, 8);
  }