Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9174

Add option to replace component path to content path

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Dynamic Include 3.1.6
    • None
    • Extensions
    • None

    Description

      The SDI module currently includes the path of the component in the SSI directive which creates the cache under the page where the component is added. 

      There are number of cases where we create content which gets reused across the website. In order to achieve reusability, we create proxy components which in turn makes a call to the reusable content pages. 

      EXAMPLE

      Proxy component: banner-proxy
      Reusable content page: /content/sdi/us/en/content/banner
      Pages: /content/sdi/us/en/test-sdi1, /content/sdi/us/en/test-sdi2

      The banner-proxy component exists on both pages: test-sdi1 and test-sdi2 page to render /content/sdi/us/en/content/banner.

      If we enable SDI and enable caching for banner-proxy component then 2 cache entries get created: /content/sdi/us/en/test-sdi1/_jcr_content/root/banner-proxy and /content/sdi/us/en/test-sdi2/_jcr_content/root/banner-proxy

      When any change is made to /content/sdi/us/en/content/banner page, it should reflect the changes on test-sdi1 and test-sdi2 page for which we need to write extra code to find the occurrences of where the proxy banner component is used to evict the cache.

      With the enhancement the SSI directive includes the path of the content: /content/sdi/us/en/content/banner, the system creates a single cache entry for the page that is referenced. By having the SSI component included by reference, any updates to the parent page are reflected in the including pages, removing the need to re-render or update each including page

       

      Benefits:

      1. Performance
        • Considerably reduces the number of calls to the server
      2. Cache Optimisation
        • No custom code to invalidate cache entries created under every page

      Current implementation:

      ## Directive added in the page after processing of SDI
      <!--#include virtual="/content/sdi/us/en/test-sdi1/_jcr_content/root/banner-proxy.nocache.html" -->
      

      Enhancement:

      ## Directive added in the page after processing of SDI
      <!--#include virtual="/content/sdi/us/en/content/banner.content.nocache.html" -->
      

      Below are the differences when it comes to caching:

       

      Attachments

        1. 2020-12-12_15-44-21.png
          85 kB
          Achim Koch
        2. 2020-12-12_16-56-21.png
          641 kB
          Achim Koch
        3. Dynamic-Include-Cache.png
          370 kB
          Kunal Mittal

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kmittal Kunal Mittal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m