diff --git a/docs/en/02_Developer_Guides/08_Performance/00_Partial_Caching.md b/docs/en/02_Developer_Guides/08_Performance/00_Partial_Caching.md index e0ca6e19a..ddb63074b 100644 --- a/docs/en/02_Developer_Guides/08_Performance/00_Partial_Caching.md +++ b/docs/en/02_Developer_Guides/08_Performance/00_Partial_Caching.md @@ -209,8 +209,8 @@ could also write the last example as: <% end_cached %>
-Currently cached blocks can not be contained within if or loop blocks. The template engine will throw an error -letting you know if you've done this. You can often get around this using aggregates. +Currently a nested cache block can not be contained within an if or loop block. The template engine will throw an error +letting you know if you've done this. You can often get around this using aggregates or by un-nesting the block.
Failing example: @@ -219,7 +219,7 @@ Failing example: <% cached $LastEdited %> <% loop $Children %> - <% cached LastEdited %> + <% cached $LastEdited %> $Name <% end_cached %> <% end_loop %> @@ -239,6 +239,19 @@ Can be re-written as: <% end_cached %> +Or: + + :::ss + <% cached $LastEdited %> + (other code) + <% end_cached %> + + <% loop $Children %> + <% cached $LastEdited %> + $Name + <% end_cached %> + <% end_loop %> + ## Cache expiry The default expiry for partial caches is 10 minutes. The advantage of a short cache expiry is that if you have a problem