1

In Drupal 8, CSS files, images and many other files, are cached by appending a token at the end, as in /sites/default/files/styles/lrg_thumbnail/public/p2i-product_1_zoomout.png?itok=DroPCbms.

Notice the itok=DroPCbms part.

What Drupal function returns this code?

1 Answer 1

3

Contrary to CSS/JS the itok is not for caching, but for DoS protection, see this question
Why are tokens added to image URLs?

The token is generated in
https://api.drupal.org/api/drupal/core%21modules%21image%21src%21Entity%21ImageStyle.php/function/ImageStyle%3A%3AgetPathToken/8.2.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.