Media file generation/caching

Hi folks, new to Grav. I’ve been looking through the documentation, but there is little mentioned about the thumbnail or media size generation/caching (and regeneration).

From a few scattered references in the docs and here in Discourse, it seems that images are dynamically generated if they specifically reference some kind of transformation. My question is:

  • When does that file generation happen? Is it the case it happens the first time the page with the image renference is called, and thereafter the file is cached and does not get regenerated?

  • When recaching the site, do all files need to get regenerated as well? It seems the images are kept in the system cache, so wondering if they also get flushed.

  • If these image variations (e.g., thumbnails) do not get automatially flushed on cache flush, how does one tell the system to regenerate a single or many, or all of these image variations?

  • Do any of the caching plugins specifically deal with image generation as well, or is that page-level caching?

Thanks for any suggestions about how this system works.