Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-17236

cache-block subtree_expiry missing documentation that node id is supported

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 4.4.0
    • 4.0.7, 4.1.4, 4.2.0, 4.3.0, 4.4.0beta2
    • Documentation
    • None

    Description

      And as noted in related issue, using node id should be highly recommended as you don't get issues when url changes and multi lingual uri issues.
      In addition it is faster internally as the code don't have to lookup node id..

      While on it change "Summary" to (to avoid issues like http://issues.ez.no/IssueView.php?Id=8709&activeItem=9):
      {{Caches the contents of a template block to static content for fast retrieval.
      Useful to avoid fetching content over and over from database when it is possible to cache it within a set of parameters.
      Note: cache-blocks also introduces some overhead, so do not have to many of them on a page, let them span parts of your page like e.g. header, footer and left menu.}}

      Change "Parameters" to:
      {{subtree_expiry string or integer A subtree that expires the cache block, either node url alias or node id. No.}}

      Change "Subtree expiration" to:
      {{The "subtree_expiry" parameter can be used to bind the expiration of a cache block to a certain part of the content node tree. When this is done, the block will expire if an object is published below the given subtree instead of the entire tree. In addition, it will also expire after two hours unless an alternative time is specified using the "expiry" parameter.
      Value can be either node url alias, a node id or system url in the following format: "content/view/full/<node_id>".
      Note: Using node id is recommended as it avoids node id lookup by url, avoids potential issues if url is changed and multi lingual url if you hard code url alias and it's used on a siteaccess with different locale.}}

      Change current example (Example 6) to:

      {cache-block subtree_expiry=44}
      ...
      {/cache-block}
      

      This example demonstrates how to create a cache block that will expire only if something is modified within the subtree of node id '44', for example if sub content is modified or new content is published beneath this node.

      Additional example (Example 7):

      {cache-block subtree_expiry=$my_node.node_id}
      ...
      {/cache-block}
      

      This example demonstrates how to create a cache block that will expire only if something is modified within the subtree of $my_node. Example demonstrates that node id can come from an dynamic variable.

      Attachments

        Activity

          People

            gaw gaw
            andre1 andre1
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: