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

Documentation: View cache files generated when cache_ttl=0 and scope error

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Customer request
    • 4.6.0, 4.7.0, 5.1, 5.2
    • Documentation
    • None
    • any ezp 4.x or 5.x using LS mode

    Description

      this text explains the usage of the cache_ttl parameter:
      If you need to disable view caching for a specific page, add the following line in the beginning of the template that is used:

      {set-block scope=global variable=cache_ttl}0{/set-block}
      

      This will set the global variable "cache_ttl" to zero for the current template. The "cache_ttl" variable contains the TTL (Time To Live) value as seconds. A value of 0 means that the result should not be changed. A value of -1 means that the view cache should never expire, see the example from http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Features/View-caching/Configuring-the-view-cache.

      1 - the example is broke. should be scope=root, not scope=global

      2 - assuming that

      {set-block scope=root variable=cache_ttl}0{/set-block}
      

      is used (there are some cases in the distributed installation) the documentation implies that setting cache_ttl = 0 will stop the view cache from being generated to to file system. it is not the case. according to the comment found in the code, the intention is another. from the code eZNodeViewFunctions::generateNodeViewData():

       
      // if cache_ttl is set to 0 from the template, we need to add a no-cache advice
      // to the node's data. That way, the retrieve callback on the next calls
      // will be able to determine earlier that no cache generation should be started
      // for this node
      if ( $cacheTTL == 0 )
      {
          $Result['no_cache'] = true;
      }
      

      the point 1. needs fixing, and point 2. needs a proper documentation/use case.

      Attachments

        Activity

          People

            Unassigned Unassigned
            paulo.bras-obsolete@ez.no Paulo Bras (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 45 minutes
                3h 45m