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


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

Your Answer

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

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