Generate thumbnails before they are requested

Is there is a way to generate thumbnails throughout the site without requesting them from the front end? I have a site with a lot of images using srcset, so visiting the front end page only generates the thumbnails for that breakpoint. If someone visits the site for a breakpoint that has not been generated, it’s going to be very slow.

I know I could use a hook to generate thumbnails when the image is uploaded to the panel, but I’m looking for a way to do it now that everything is already there. Thanks

This script by @lukaskleinschmidt generates all thumbnails on your site:


Thank you @thguenther and @lukaskleinschmidt
But how is this script meant to be used? It’s not clear to me from the gist.

Do you create three new folders in the project root?

Checkout this plugin:

It has a job for pre-generating thumbs as well.


The janitor plugin did the trick. Thank you @texnixe!

1 Like