Lava Example - 79
Prompt
Let's dig into how the {% cache %} command works.
Create some content (HTML and Lava or just HTML), and cache it. (Avoid colliding with other people in class by using your name as the tag; for example {% cache tag:'ted-decker' duration:'10' %}{% endcache %}).
We recommend a nice short duration, such as 10 seconds, so you can test and confirm how it expires.
Use Lava that automatically changes without you changing the template - such as showing the current time. Run your template multiple times in a row, and if it's cached you shouldn't see it change until the cache expires.
Stretch Goal:
Add a second line with your time output wrapped in a tag and use TwoPass in the cache tag to see the difference.
Initial Code
<p>{{ 'Now' | Date:'HH:mm:ss' }}</p>
Solution Lava
{% cache tag:'your-name' duration:'10' %}
<p>{{ 'Now' | Date:'HH:mm:ss' }}</p>
{% endcache %}