I am currently building a website that consist almost entirely of blocks.
There are quite a few pages that use the same blocks, but sometimes with slightly different content and not always in the same order.
I have built a matrix field to construct each page out of these blocks and most of these blocks have their own template.
Basically I do this:
{% for block in matrix %}
{% if block.type == 'type1' %}
{% include 'type1.twig' %}
{% elseif block.type == 'type2' %}
{% include 'type2.twig' %}
{% endif %}
{% endfor %}
Some of these blocks however, also have for loops in them accessing matrix fields.
I was wondering if it is possible to use {% cache %} tags around my for loop that loops through all the basic blocks, and then within my block templates another {% cache %} tag but with the globally parameter.
So in short, can I safely use cache tags inside other cache tags?