Uploaded image for project: 'Advanced Cache'
  1. Advanced Cache
  2. MGNLADVCACHE-99

Personalization cache on inherited personalized components not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: personalization
    • Environment:
      Debian (hosted), OS X (local development)

      Description

      Hello Magnolia Team,

      we've run into another issue regarding personalization and caching.
      (Last year i already opened a ticket under https://jira.magnolia-cms.com/browse/MGNLADVCACHE-94 with a similar problem).

      Short description:
      In PersonalizedCacheStore#isPersonalized (or as well in PersonalizedCachePolicy#shouldCache) there's a visitor running to check the requested page node for any personalized components. The problem: The visited node is not wrapped with an InheritanceNodeWrapper, so any personalized components inherited from a parent page aren't visited which will of course break the cache since magnolia will treat this page as a normal page and not a personalized page (In this case, if a personalized page was cached first, all users after that will get the same personalized page displayed even if they don't match the traits).

       

      I'll also provide an example:

      On the project we currently have an "Overlay" Area inheriting components to all subpages. In this area we have a personalized component which should be displayed under certain conditions.

      Hope this is somehow understandable
      (right now it's not a time critical issue since we are still in the "experimental" phase)

      Visiting the root page it's fine:

      (Breakpoint in PersonalizedCacheStore#isPersonalized)

      The component itself (correctly wraped with the variant):

      Visiting a subpage:

      (The personalized component is correctly displayed on the subpage)

      This will lead to the method returning false and thus wrongly caching the page as a normal page.
      I could also reproduce this on the current demo instance.

       

      I already thought about possible solutions:
      The most reasonable solution I came up with would be by modifying the visitor to wrap the visited nodes before visiting them by using DefaultInheritanceContentDecorator#wrapNode.
      Maybe there are easier solutions to that issue or I'm missing here something 

      Thank you in advance for investigating the issue!

       

      On behalf of AllSecur

      Olaf Kozlowski
      Lemonize GmbH

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mkemser Michael Kemser
            Visible to:
            Jens Kolb, Olaf Kozlowski
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response: