<p>I finally got the chance to update Craft from 2.0 to 2.1 and that seems to have made the cache tag function as expected. (And it is terrific.)</p>

<p>Thanks for the help,
Willhaus</p>

CC BY-SA 3.0
2014-07-11T21:23:02.767Z
2014-07-11T21:23:02.767Z
Willhaus
<p>The <code>{% cache %}</code> 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.</p>

CC BY-SA 3.0
2014-07-11T21:24:11.670Z
The image transform were actually generating fine. I could see them in the markup in the data-original attribute even before the plugin generated the src tag.
Willhaus
CC BY-SA 3.0
2014-07-07T14:24:47.657Z
2014-07-07T14:24:47.657Z
Brandon Kelly
<p>The image tag shown below prevents my {% cache %} tag from caching the loop it's in. If I remove the image tag or change the data-resource attribut to a normal src, it works fine. The class="lazy" and data-original are from the jQuery plugin Lazy Load 1.9.3. Regardless, the page still renders fine. Does anyone have any ideas what's wrong?</p>

<p>Thank you for your help for a first-time poster.</p>

<pre><code>&lt;img class="lazy" data-original="{{ image.getUrl(transform) }}" alt="{{ project.title }}" /&gt;
</code></pre>

<p>EDIT: Now showing just the code that seems to be the problem rather than the whole loop.</p>

CC BY-SA 3.0
2014-07-04T09:21:51.367Z
Good to hear that you figured it out. Could you now please slim down your code to only the relevant parts to make this question helpful for others?
carlcs
CC BY-SA 3.0
2014-07-04T15:00:24.303Z
Done. Thanks for the suggestion. Still wondering what makes the cache fail, though.
Willhaus
<cache>
Cache tag won’t cache in a template
# Cache tag won’t cache in a template

(Asked by: username_0 on 2014-07-03)

The image tag shown below prevents my {% cache %} tag from caching the loop it's in. If I remove the image tag or change the data-resource attribut to a normal src, it works fine. The class="lazy" and data-original are from the jQuery plugin Lazy Load 1.9.3. Regardless, the page still renders fine. Does anyone have any ideas what's wrong?
Thank you for your help for a first-time poster.


EDIT: Now showing just the code that seems to be the problem rather than the whole loop.

**Tags:** cache

> **Comments:**
> **username_1**: Good to hear that you figured it out. Could you now please slim down your code to only the relevant parts to make this question helpful for others?  
> **username_0**: Done. Thanks for the suggestion. Still wondering what makes the cache fail, though.  

---

## 2 answers

### Answer by username_0 on 2014-07-11. Score: 2 | Accepted answer

I finally got the chance to update Craft from 2.0 to 2.1 and that seems to have made the cache tag function as expected. (And it is terrific.)

Thanks for the help,
username_0


---

### Answer by username_2 on 2014-07-07. Score: 8

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.

> **Comments:**
> **username_0**: The image transform were actually generating fine. I could see them in the markup in the data-original attribute even before the plugin generated the src tag.  

---

