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

Move clearObjectViewCache to end of the publishing process to avoid new cache with old content while publishing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Obsolete
    • Affects Version/s: 4.1.3, 4.1.4, 4.2.0
    • Fix Version/s: Customer request, Future
    • Component/s: Caching
    • Labels:
      None

      Description

      When you publish an object the system will - among others - do the following thing:

      clearObjectViewCache
      generateObjectViewCache (if previewcache enabled i assume)
      registerSearchObject
      createNotificationEvent
      removeTemporaryDrafts
      post_publish

      The objects does not actuallay get published before (after) the last step, but after clearobjectviewcache the cache is expired. If a customes views the object between clearObjectViewCache and the object is actually published, the system will render a new compiled template and store it - but with the old content. The cache is now not expired, and the system will continue to display the old content.

      With delayedindexing off and/or a long post_publish workflow time, this will hapen quite often.

      It will continue in the left three from http://share.ez.no/articles/ez-publish/ez-publish-knowledge-series-stale-cache-or-how-caches-in-ez-publish-4.1-are-handled-in-a-smarter-way/%28page%29/2

      Steps to reproduce

      Testet with standard eZ 4.2.0 from http://ez.no/download

      It can be reproduced in the following way:

      To simulate that registersearchobject takes af realy long time add

      sleep(30);

      on line 539 (just after static public function registerSearchObject( $objectID, $versionNum ) in

      kernel/content/ezcontentoperationcollection.php

      Steps:
      1 Backend, edit frontpage
      2 Change anything, example - add "test" to "Left column:"
      3 Push publish
      4 wait a few seconds
      5 Watch the frontend - old content will show
      6 Wait
      7 watch the frontend - old content will still show

      To show the cache while publishing is the problem, do it again - but wait until the object is fully published, add more info, view the frontpage, the page will now be updated.

      The clearobjectviewcache should possibly be done after the object is fully published.

      Best Regards
      Adam Helms

        Activity

        Hide
        Jérôme Renard added a comment -

        Confirmed on 4.2.1

        Show
        Jérôme Renard added a comment - Confirmed on 4.2.1
        Hide
        Jérôme Renard added a comment -

        We can not move clearObjectViewCache at the end of the publishing process.

        It is unfortunately not that simple.

        We have to take into account that any call to clearObjectViewCache add overhead on the cluster handler and thus affects performances.

        Show
        Jérôme Renard added a comment - We can not move clearObjectViewCache at the end of the publishing process. It is unfortunately not that simple. We have to take into account that any call to clearObjectViewCache add overhead on the cluster handler and thus affects performances.
        Hide
        ezrobot added a comment -

        This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

        Show
        ezrobot added a comment - This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

          People

          • Assignee:
            unknown
            Reporter:
            Adam Helms
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: