Cache tag won’t cache in a template
The {% cache %} tag will detect if there are any ungenerated image transforms within it. If there are, it will hold off on caching the template until the next request, so that the temporary image URL won’t get cached.