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

Clear HTTP cache when trashing, recovering and deleting content/locations

    Details

      Description

      Steps:

      1. Go to PlatformUI;
      2. Create 10 Articles
      3. Go to these articles parent Location
      4. Click on each of the articles and "Send to Trash"
      5. The number of "Sub-items" will remain the same and the "Next >" "Last >" links will be active

        Issue Links

          Activity

          Hide
          Damien Pobel (Inactive) added a comment -

          I guess it only happens in the prod environment and then it comes from the cache issue as the one behind EZP-24708.

          Show
          Damien Pobel (Inactive) added a comment - I guess it only happens in the prod environment and then it comes from the cache issue as the one behind EZP-24708 .
          Hide
          Damien Pobel (Inactive) added a comment -

          Easier way to reproduce: no need to create 10 articles, one is enough

          Show
          Damien Pobel (Inactive) added a comment - Easier way to reproduce: no need to create 10 articles, one is enough
          Show
          Bertrand Dunogier added a comment - PR https://github.com/ezsystems/ezpublish-kernel/pull/1635 .
          Hide
          André Rømcke added a comment - - edited

          Suggested approach to fix summarized on the now closed PR above:

          Temporary fix to solve the fatal errors*:
          • keep the new Slot added in https://github.com/ezsystems/ezpublish-kernel/pull/1635.
          • however also add a new PurgeForLocationHttpCacheSlot and use it instead here and in MoveSubtreeSlot and UnnassignUserFromUserGroupSlot, deprecate PurgeAllHttpCacheSlot. You'll end up using GatewayCachePurger->purge() for this which is deprecated, reason why it is deprecated is that it can not take advantage of the Cache clear rules using the ContentCacheClearEvent stuff, however maybe that is ok, as the feature seems miss designed, see also below.

          This will esentially also solve https://jira.ez.no/browse/EZP-24621

          Followup story to solve it fully, options:
          • Either we change the API on such operations to be a command (start move towards CQRS), and lets events/slots enhance the command object so it can add meta info about affected location id's for instance which is used after the operation itself to clear cache.
            • Alternatively as part of this we handle commands async, so then we can handle operation in batch and get it to emit events for every single location deleted, meaning bug fix done now will be useful as we discussed above.
          • Or we solve this with HTTPCache multi tagging, however this is progressing slowly at FOS.
          • Or we can as a bit smaller effort add array for affected location id's on signals affecting trees, and get SignalSlot repo to call a new spi/api to get location id's in a tree before the operation itself (so similar to option 1, easier todo, no api change, but not as clean).
          Show
          André Rømcke added a comment - - edited Suggested approach to fix summarized on the now closed PR above: Temporary fix to solve the fatal errors*: keep the new Slot added in https://github.com/ezsystems/ezpublish-kernel/pull/1635 . however also add a new PurgeForLocationHttpCacheSlot and use it instead here and in MoveSubtreeSlot and UnnassignUserFromUserGroupSlot, deprecate PurgeAllHttpCacheSlot. You'll end up using GatewayCachePurger->purge() for this which is deprecated, reason why it is deprecated is that it can not take advantage of the Cache clear rules using the ContentCacheClearEvent stuff, however maybe that is ok, as the feature seems miss designed, see also below. This will esentially also solve https://jira.ez.no/browse/EZP-24621 Followup story to solve it fully, options: Either we change the API on such operations to be a command (start move towards CQRS), and lets events/slots enhance the command object so it can add meta info about affected location id's for instance which is used after the operation itself to clear cache. Alternatively as part of this we handle commands async, so then we can handle operation in batch and get it to emit events for every single location deleted, meaning bug fix done now will be useful as we discussed above. Or we solve this with HTTPCache multi tagging, however this is progressing slowly at FOS. Or we can as a bit smaller effort add array for affected location id's on signals affecting trees, and get SignalSlot repo to call a new spi/api to get location id's in a tree before the operation itself (so similar to option 1, easier todo, no api change, but not as clean) .
          Hide
          Damien Pobel (Inactive) added a comment -

          Any news on that ? QA reported EZP-25920 which is a direct consequence of this one

          Show
          Damien Pobel (Inactive) added a comment - Any news on that ? QA reported EZP-25920 which is a direct consequence of this one
          Hide
          Damien Pobel (Inactive) added a comment -

          André Rømcke alright, then it should probably not be in the inputQ nor assigned to you (I had the impression you were about to start on it).

          Also, I think we have a similar same cache issue in EZP-25919 where the REST resources /api/ezp/v2/content/objects/<ContentId> are not cleared when sending or restoring the main Location of the Content <ContentId> to/from the trash.

          Show
          Damien Pobel (Inactive) added a comment - André Rømcke alright, then it should probably not be in the inputQ nor assigned to you (I had the impression you were about to start on it). Also, I think we have a similar same cache issue in EZP-25919 where the REST resources /api/ezp/v2/content/objects/<ContentId> are not cleared when sending or restoring the main Location of the Content <ContentId> to/from the trash.
          Show
          André Rømcke added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/1746
          Hide
          André Rømcke added a comment - - edited
          Show
          André Rømcke added a comment - - edited Merged: https://github.com/ezsystems/ezpublish-kernel/commit/5aee894772ca931614e98008774c112ae000f85c QA: See this issue + sub task.
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 1.3, 1.4 and master.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 1.3, 1.4 and master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Pedro Resende (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 30 minutes
                4h 30m