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

Varnish cache should be purged for related content

    Details

      Description

      Currently, the Varnish cache is not purged when editing related content because of missing relation-<content-id> tag. Relevant documentation: https://github.com/ezsystems/ezplatform-http-cache/blob/97689d1f5182bc80aea55dc9fcd771ddd8cc53df/docs/using_tags.md#tags-in-use-in-this-bundle.

      Steps to reproduce:

      1. Set up eZ Platform installation with Varnish using xkey VCL.
      2. In Media/Images, create a new Image Content Object named "Test Image".
      3. Under "Home", create a new Article Content Object named "Test Article". In the "Image" Field for this Content Object, select "".
      4. Access your_site.example/Test-Article. It should correctly display the Article. There should be a link leading to "your_site.example/Media/Images/Test-Image" with the text "Test Image".
      5. Now, rename "Test Image" to "Test Image Edited" using Platform UI.
      6. Access your_site.example/Test-Article again. There will be a link leading to "your_site.example/Media/Images/Test-Image" with the text "Test Image". Instead, there should be a link leading to "your_site.example/Media/Images/Test-Image-Edited" with the text "Test Image Edited".

        Issue Links

          Activity

          Show
          André Rømcke added a comment - - edited Merged https://github.com/ezsystems/ezplatform-http-cache/commit/bb03278a3b70e1e04bef064b5ae64921c33eec8c
          Hide
          Pierre-Julien Cazaux added a comment -

          Hello, even if this issue is marked as fix version 1.13.1-RC1, the installation of the release do not correct the issue.Can you please provide a delivery version ? thx

          Show
          Pierre-Julien Cazaux added a comment - Hello, even if this issue is marked as fix version 1.13.1-RC1, the installation of the release do not correct the issue.Can you please provide a delivery version ? thx
          Hide
          André Rømcke added a comment - - edited

          Hi Pierre-Julien,

          this issue is still in QA which is why we have not replied on this yet in your support ticket. The work here so far makes it possible to tag responses with things like relation. So you can already overload the affected templates and add the given tags to try this out, diff below should give your developers a clear enough hint on how to use the new feature in ezplatform-http-cache v0.4.2:

          diff --git a/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig
          index 9a9eaa8822..eacfbb7efe 100644
          --- a/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig
          +++ b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig
          @@ -265,6 +265,7 @@
               {% if not ez_is_field_empty( content, field ) %}
               <ul {{ block( 'field_attributes' ) }}>
                   {% for contentId in field.value.destinationContentIds %}
          +        {{ fos_httpcache_tag('relation-' ~ contentId) }}
                   <li>
                       {{ render( controller( "ez_content:viewAction", {'contentId': contentId, 'viewType': 'embed', 'noLayout': 1} ) ) }}
                   </li>
          @@ -435,6 +436,7 @@
           {% block ezobjectrelation_field %}
           {% spaceless %}
           {% if not ez_is_field_empty( content, field ) %}
          +    {{ fos_httpcache_tag('relation-' ~ field.value.destinationContentId) }}
               <div {{ block( 'field_attributes' ) }}>
                   {{ render( controller( "ez_content:viewAction", {'contentId': field.value.destinationContentId, 'viewType': 'text_linked', 'noLayout': 1} ) ) }}
               </div>
          

          Show
          André Rømcke added a comment - - edited Hi Pierre-Julien, this issue is still in QA which is why we have not replied on this yet in your support ticket. The work here so far makes it possible to tag responses with things like relation. So you can already overload the affected templates and add the given tags to try this out, diff below should give your developers a clear enough hint on how to use the new feature in ezplatform-http-cache v0.4.2: diff --git a/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig index 9a9eaa8822..eacfbb7efe 100644 --- a/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig +++ b/eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig @@ -265,6 +265,7 @@ {% if not ez_is_field_empty( content, field ) %} <ul {{ block( 'field_attributes' ) }}> {% for contentId in field.value.destinationContentIds %} + {{ fos_httpcache_tag('relation-' ~ contentId) }} <li> {{ render( controller( "ez_content:viewAction", {'contentId': contentId, 'viewType': 'embed', 'noLayout': 1} ) ) }} </li> @@ -435,6 +436,7 @@ {% block ezobjectrelation_field %} {% spaceless %} {% if not ez_is_field_empty( content, field ) %} + {{ fos_httpcache_tag('relation-' ~ field.value.destinationContentId) }} <div {{ block( 'field_attributes' ) }}> {{ render( controller( "ez_content:viewAction", {'contentId': field.value.destinationContentId, 'viewType': 'text_linked', 'noLayout': 1} ) ) }} </div>
          Hide
          Pierre-Julien Cazaux added a comment -

          Thk you André Rømcke for this feedback.

          In order to manage priorities with my dev team, I rather prefer to watch the git repo for a new release (eg 1.13.2 ?) for the team to install, rather than manually integrate the change and also install the next versions... That's why I only need to know in witch release you expect this topic to be handled and if possible, when it will be released.

          Thx you for your understanding.
          Best,
          PJ

          Show
          Pierre-Julien Cazaux added a comment - Thk you André Rømcke for this feedback. In order to manage priorities with my dev team, I rather prefer to watch the git repo for a new release (eg 1.13.2 ?) for the team to install, rather than manually integrate the change and also install the next versions... That's why I only need to know in witch release you expect this topic to be handled and if possible, when it will be released. Thx you for your understanding. Best, PJ
          Hide
          André Rømcke added a comment -

          Additional changes to kernel made in: https://github.com/ezsystems/ezpublish-kernel/commit/02337fb614dd4e1e79b61aff0edd9d2e1f25c567, these will come in upcoming v1.13.2 and v2.1.0 releases.

          NOTE: This should cover most normal operations on relations refreshing the inline view where they are embedded, handling on more advance actions like subtree delete will need future imporvments/stories on the product but at least all needed meta info for that is now in place for relation/relationsList/RichText fieldtypes embedding of relations.

          Show
          André Rømcke added a comment - Additional changes to kernel made in: https://github.com/ezsystems/ezpublish-kernel/commit/02337fb614dd4e1e79b61aff0edd9d2e1f25c567 , these will come in upcoming v1.13.2 and v2.1.0 releases. NOTE: This should cover most normal operations on relations refreshing the inline view where they are embedded, handling on more advance actions like subtree delete will need future imporvments/stories on the product but at least all needed meta info for that is now in place for relation/relationsList/RichText fieldtypes embedding of relations.
          Hide
          André Rømcke added a comment - - edited

          Pierre-Julien Cazaux On open source repositories they can easily do this (once it's merged), I'll leave it up to the reader to understand where to place the version constraint , but the constraint would for instance be `~6.13.1@dev` in this case in order to get on going work towards 6.13.2 of the given package affected here.

          Show
          André Rømcke added a comment - - edited Pierre-Julien Cazaux On open source repositories they can easily do this (once it's merged), I'll leave it up to the reader to understand where to place the version constraint , but the constraint would for instance be `~6.13.1@dev` in this case in order to get on going work towards 6.13.2 of the given package affected here.
          Hide
          Pierre-Julien Cazaux added a comment -

          Thank you @André Rømcke for this feedback. We then look forward the 1.13.2 delivery. Do you - by any chance - have an idea of the release date ? Thx again

          Show
          Pierre-Julien Cazaux added a comment - Thank you @André Rømcke for this feedback. We then look forward the 1.13.2 delivery. Do you - by any chance - have an idea of the release date ? Thx again
          Hide
          André Rømcke added a comment -

          Pierre-Julien Cazaux The last change is now out as part of v6.13.1.2 micro release, it will also become part of upcoming full releases: v2.1 this month and v1.13.2 next month.

          Show
          André Rømcke added a comment - Pierre-Julien Cazaux The last change is now out as part of v6.13.1.2 micro release, it will also become part of upcoming full releases: v2.1 this month and v1.13.2 next month.
          Hide
          Pierre-Julien Cazaux added a comment -

          Ok thx for this feedback

          Show
          Pierre-Julien Cazaux added a comment - Ok thx for this feedback

            People

            • Assignee:
              Unassigned
              Reporter:
              Jacek Foremski (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: