Skip to content

Commit

Permalink
Add documentation for snippet area cache settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Feb 12, 2024
1 parent b01584c commit 03d882f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cookbook/default-snippets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,28 @@ and can be assigned to a snippet that uses the respective template.
</meta>
<areas>
<area key="menu_social_media_links">
<area key="menu_social_media_links" cache-invalidation="true">
<meta>
<title lang="en">Menu Social Media Links</title>
</meta>
</area>
<area key="footer_social_media_links">
<area key="footer_social_media_links" cache-invalidation="false">
<meta>
<title lang="en">Footer Social Media Links</title>
</meta>
</area>
</areas>
For each area you can also define if the cache should be invalidated when either the snippet is
changed or the snippet assigned to the area is modified/removed. This can be done by setting the
``cache-invalidation`` attribute of the area to ``true`` or ``false``, the default value is ``true``.

.. note::

Be aware that if a default-snippet is used in a base twig template, modifying the snippet or the
area may result in a full cache invalidation of the website.

Loading the default snippet inside of a twig template
-----------------------------------------------------

Expand Down

0 comments on commit 03d882f

Please sign in to comment.