Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Efficiently Caching : Localised XF with SDI for MSM | AEM Community Blog Seeding

kautuk_sahni
Community Manager
Community Manager

BlogImage.jpg

Efficiently Caching : Localised XF with SDI for MSM by AEM Concepts

Abstract

Even though we improved caching by introducing SDI in previous article, but SDI with XF don’t work in case of multilingual sites.

OOTB experience fragment(w/o SDI) works by rendering the localised XF on the fly for multilingual sites. However the XF component doesn’t have any provision for SDI. The ootb code is not able to pick up localised XF’s if we render XF’s using SDI.

Why Localised XF don’t work with SDI on the dispatcher?

If we use SDI the currentPage object points to template page(ie /conf) though the OOTB XF code expects current page to be pointing to the content page(ie /content) and not the template page and hence the code breaks in case of SDI XF for MSM and it is not able to deliver localized XF’s on the dispatcher.

Hence we need to tweak the OOTB XF component if we want to be able to extend it for SDI’s. Follow the steps below to extend the OOTB XF component for SDI’s.

1) Add suffix=current page

Add rewrite rule to append suffic to the sdi call on page



# RewriteRule ^(.*)$ $1%{ENV:DOCUMENT_URI} [PT,QSD]
RewriteCond %{REQUEST_URI} .xf.html$
RewriteCond %{REQUEST_URI} ^/(content|conf)
RewriteRule ^(.*)$ $1%{ENV:DOCUMENT_URI} [PT]



2) Modify the OOTB XF code to read the current page from suffix.
com.demo.web.core.models.impl.ExperienceFragmentImpl

Read Full Blog

Efficiently Caching : Localised XF with SDI for MSM

Q&A

Please use this thread to ask the related questions.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies