<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kaikubad on Medium]]></title>
        <description><![CDATA[Stories by Kaikubad on Medium]]></description>
        <link>https://medium.com/@kaikubad?source=rss-b297fd9c83dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*M6BPee0P1ySRe3kJ</url>
            <title>Stories by Kaikubad on Medium</title>
            <link>https://medium.com/@kaikubad?source=rss-b297fd9c83dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:33:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kaikubad/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AEM’s replication system, along with Replication Agents and Dispatcher Flush Agents]]></title>
            <link>https://kaikubad.medium.com/aems-replication-system-along-with-replication-agents-and-dispatcher-flush-agents-b0a7a909ce74?source=rss-b297fd9c83dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0a7a909ce74</guid>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[dispatcher]]></category>
            <category><![CDATA[replication]]></category>
            <dc:creator><![CDATA[Kaikubad]]></dc:creator>
            <pubDate>Thu, 25 Jan 2024 07:29:22 GMT</pubDate>
            <atom:updated>2024-01-30T05:28:02.271Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZx1NmtXOxToh-UUOKDDOQ.jpeg" /></figure><p><strong>The whole process:</strong></p><p>The process starts when author selects quick publish/publish page after editing. Then a servlet is called <strong><em>/libs/wcm/core/content/reference.json?_charset_=utf-8&amp;path={the-page-path} .</em></strong> This servlets checks for references of that page. References means if there is unpublished asset, experience-fragments etc. If yes then there is another screen shown with the linked references which will also be published with the page publish.</p><p>Author can check unchecked references which is going to publish. When author again click publish after reviewing then again a servlet is called <strong><em>bin/replicate.</em></strong></p><p>Now the replication agent comes in picture. The <em>pages/assets/tags</em> which author is trying to publish is now sent to replication queue. The replication agent then pics from the replication queue. Usually for each publish instance there is one replication agent on author.</p><p><strong>How to create a replication agent?</strong></p><p>Go to <a href="http://localhost:4502/miscadmin#/etc/replication/agents.author">http://{domain}:4502/miscadmin#/etc/replication/agents.author</a>. Click new. Give a name and select Replication agent from the list. Click create and now this agent will be listed on replication agents list. Now double click on the agent that you have created and go to edit. Now go to transport tab and find the internal ip of your one publish environment. Set the transport url to <a href="http://{private-ip}:{publish-port}/bin/receive?sling:authRequestLogin=1">http://{private-ip}:{publish-port}/bin/receive?sling:authRequestLogin=1</a>. Also fill the username and password. Click ok. We are done creating our first replication agent. Follow this same process to create more replication agent for other publishers. Checkout the screenshots attached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYB9Hoqkn3PBj9MCueoPDQ.jpeg" /></figure><p>Now we have our replication agents ready on author. This replication agent is responsible for replicating content from author to publish. On the transport tab you can see the URI which is the publish instance url. Also you have to use a credential there with replication permission. Replication agent calls the api to publish instance with the paths you are trying to publish and then its replicated to publish. If you have noticed, when we publish a page the corresponding dispatcher cache also gets clear. How?</p><p><strong>How dispatcher cache is cleaned when page is published?</strong></p><p>On each publish instance there is a dispatcher flush agent which triggers the dispatcher cache clean request from publish to dispatcher. Whenever a page is published this <strong><em>Dispatcher Flush Agent</em></strong> gets triggered.</p><p>The creating process is almost same as we have done for replication agent on author. But you have to create it on publish. Goto <a href="http://localhost:4503/miscadmin#/etc/replication/agents.publish">http://{publish-host}:{publish-port}/miscadmin#/etc/replication/agents.publish</a></p><p>Follow the screenshots here. I am not going to describe on it because they are basics and you have basic idea of it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D7iZHupiqd5OltlX1Nz3dQ.png" /></figure><p>Now our dispatcher flush agent is ready. When author publishes anything from author the replication agent publish it to each publish and the the dispatcher flush agent triggers dispatcher cache clean request to dispatcher.</p><p>You can see here the dispatcher ip is a private ip. Because adobe keep author, publish and dispatcher on same network the they are paired with each other. So on development environment they are on same network. Same for stage on prod.</p><p>If there is multiple dispatcher and publish instances then the pub-1 dispatcher flush agent cleans dispatcher -1 cache and pub-2 dispatcher flush agent cleans dispatcher-2 cache. So there are two dispatcher instances created on each publish instance.</p><p><strong><em>The end user journey</em></strong></p><p>Certainly! When a user attempts to access an Adobe Experience Manager (AEM) site, their request first traverses through a load balancer, which efficiently distributes incoming traffic across multiple servers. From there, the request is directed to the AEM Dispatcher.</p><p>The AEM Dispatcher acts as a gatekeeper, checking if the requested page is already stored in its cache. If the page is found in the cache, the Dispatcher seamlessly delivers it to the user without making an additional call to the AEM instance. This caching mechanism not only enhances the user experience by accelerating content delivery but also reduces the load on the AEM servers, promoting optimal system performance. In essence, the Dispatcher acts as a proficient intermediary, ensuring rapid access to frequently requested content while minimizing the demand on backend resources.</p><p>Certainly! In the event that the requested page is not present in the cache maintained by the AEM Dispatcher, the Dispatcher seamlessly forwards the user’s request to the corresponding AEM publish instance. The AEM publish instance, equipped with the necessary resources, processes the request and generates a response.</p><p>Following the generation of the response by the AEM publish instance, the Dispatcher promptly caches the result. It then efficiently delivers the cached response to the user’s browser, completing the transaction. It’s noteworthy that the architecture is designed for optimal load balancing and fault tolerance.</p><p>In this setup, Dispatcher-1 is intelligently connected to AEM Publish-1, and Dispatcher-2 is similarly associated with AEM Publish-2. Internally, the dispatchers are interlinked to facilitate load balancing, ensuring a balanced distribution of incoming requests across the AEM publish instances. This interconnected design not only enhances the system’s scalability but also promotes resilience, as each dispatcher can seamlessly redirect requests to the available AEM publish instance, contributing to a robust and reliable user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0a7a909ce74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discover the art of alleviating server stress by seamlessly migrating assets from AEM DAM to…]]></title>
            <link>https://kaikubad.medium.com/discover-the-art-of-alleviating-server-stress-by-seamlessly-migrating-assets-from-aem-dam-to-4956ae81ab33?source=rss-b297fd9c83dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4956ae81ab33</guid>
            <category><![CDATA[cloudinary]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[bynder]]></category>
            <category><![CDATA[digital-asset-management]]></category>
            <dc:creator><![CDATA[Kaikubad]]></dc:creator>
            <pubDate>Thu, 31 Aug 2023 12:47:57 GMT</pubDate>
            <atom:updated>2023-08-31T12:47:57.735Z</atom:updated>
            <content:encoded><![CDATA[<h3>Discover the art of alleviating server stress by seamlessly migrating assets from AEM DAM to third-party sources.</h3><p>Today, I am thrilled to unveil a strategy that promises to gracefully reduce the load on your AEM publish server. By orchestrating a harmonious migration of assets to distinguished third-party management services like Bynder, Cloudinary, and more, we open doors to a realm of optimized operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00n4cKYQQ2sqsbmGwWTebw.png" /><figcaption>Advantage of using third-party asset manager</figcaption></figure><p>If your digital platform experiences high levels of traffic or if multiple applications share common assets, this article holds invaluable insights for both you and your organization. It serves as a guide to optimizing your asset management strategy for enhanced efficiency. However, if your application is currently small in scale with limited traffic, it might be advisable to defer the implementation of this solution until a more opportune time.</p><p>In the digital landscape, we’re dealing with busy websites that draw a lot of visitors, and more websites are joining the party as we speak. Despite using a cache system to help out, our computer and resource usage is still running a bit high. This is causing some speed bumps — the whole website is slowing down, which is not what we want.</p><p>To fix this, we put on our thinking caps and came up with a plan. We want to lighten the load on our main AEM server, which is like the conductor of this digital orchestra. Part of this plan involves moving our precious files to a trusted outside source. This source has some cool tools for images — like cutting them to size, filling in colors, and making sure the important parts are front and center.</p><p>Now our assets (images, videos, pdf, pptx, xlsx, doc) has been moved to <a href="https://cloudinary.com/">cloudinary</a>. Cloudinary is a cloud-based media management platform that offers a comprehensive suite of tools and services for storing, optimizing, transforming, and delivering images and videos for websites and applications. We developed a small aem bundle which syncs assets from cloudinary to aem. Now we had nothing on aem dam. Our bundle will sync assets from cloudinary to aem dam for the purpose of authoring.</p><p>Now cloudinary assets has been synced and aem content authors has done their authoring. If we publish this page now the image will be still served from aem core image component. Because we synced images from coudinary to aem and now its like the local asset before. So we need to make to mechanism to fetch cloudinary images from different source on publish and view as published.</p><p>So we modified the image component that we were using and it was inherited from aem core image.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;jcr:root xmlns:sling=&quot;http://sling.apache.org/jcr/sling/1.0&quot; xmlns:cq=&quot;http://www.day.com/jcr/cq/1.0&quot; xmlns:jcr=&quot;http://www.jcp.org/jcr/1.0&quot;<br>    jcr:primaryType=&quot;cq:Component&quot;<br>    jcr:title=&quot;Image&quot;<br>    sling:resourceSuperType=&quot;core/wcm/components/image/v2/image&quot;<br>    componentGroup=&quot;Media&quot;/&gt;</pre><p>Then modified the image.html like following. One thing is needed to pention here that the image we synced from cloudinary have some unique attrubutes in it. So we are using those attributes to determine that if its a cloudinary image or normal aem dam image.</p><pre>&lt;sly data-sly-use.imagePicker=&quot;com.example.aem.models.ImageSourcePicker&quot;&gt;&lt;/sly&gt;<br><br>&lt;sly data-sly-test=&quot;${imagePicker.cloudinaryImage}&quot;&gt;<br>    &lt;sly data-sly-include=&quot;cloudinary-image.html&quot;&gt;&lt;/sly&gt;<br>&lt;/sly&gt;<br><br>&lt;sly data-sly-test=&quot;${!imagePicker.cloudinaryImage}&quot;&gt;<br>    &lt;sly data-sly-include=&quot;core-image.html&quot;&gt;&lt;/sly&gt;<br>&lt;/sly&gt;</pre><p>The <em>ImageSourcePicker </em>model checks if the image is <em>cloudinary</em> image or normal aem dam image. Now if its a cloudinary image then the following markup is rendered</p><pre>&lt;sly data-sly-use.model=&quot;com.example.aem.models.ImageSrcSetGenerator&quot;&gt;&lt;/sly&gt;<br><br>&lt;div id=&quot;${component.id}&quot;<br>  data-sly-use.image=&quot;com.adobe.cq.wcm.core.components.models.Image&quot;<br>     class=&quot;cmp-image${!wcmmode.disabled ? &#39; cq-dd-image&#39; : &#39;&#39;}&quot;&gt;<br>    &lt;a data-sly-unwrap=&quot;${!image.link}&quot;<br>       class=&quot;cmp-image__link&quot; href=&quot;${image.link}&quot;&gt;<br>        &lt;img<br>            data-expand=&quot;${image.lazyThreshold}&quot;<br>            src=&quot;${model.src}&quot; data-srcset=&quot;${model.srcSet}&quot;<br>            data-sly-attribute.rel=&quot;preload&quot; data-sly-attribute.fetchpriority=&quot;high&quot;<br>            class=&quot;cmp-image__image lazyload&quot; itemprop=&quot;contentUrl&quot; data-cmp-hook-image=&quot;image&quot;<br>            alt=&quot;${image.alt || true}&quot; title=&quot;${image.displayPopupTitle &amp;&amp; image.title}&quot;/&gt;<br>    &lt;/a&gt;<br>    &lt;span class=&quot;cmp-image__title&quot; itemprop=&quot;caption&quot; data-sly-test=&quot;${!image.displayPopupTitle &amp;&amp; image.title}&quot;&gt;${image.title}&lt;/span&gt;<br>    &lt;meta itemprop=&quot;caption&quot; content=&quot;${image.title}&quot; data-sly-test=&quot;${image.displayPopupTitle &amp;&amp; image.title}&quot;&gt;<br>&lt;/div&gt;</pre><p>Here what <em>ImageSrcSetGenerator</em> does is read the policy of image component and create src set (a list of sources) for lazy loading. Cloudinary have the ability to pass any cropped, filled version of your image with the width, height you provide in image url. Like this sample url <a href="https://res.cloudinary.com/demo/image/upload/c_fill,h_250,w_250/docs/models.jpg">https://res.cloudinary.com/demo/image/upload/c_fill,h_250,w_250/docs/models.jpg</a></p><p>This is how we have distributed the asset loading responsibility to cloudinary. Other asset services like bynder also can be used here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4956ae81ab33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empower AEM performance by purging Dispatcher cache effortlessly from backend (servlets or…]]></title>
            <link>https://kaikubad.medium.com/empower-aem-performance-by-purging-dispatcher-cache-effortlessly-from-backend-servlets-or-72d56e93579d?source=rss-b297fd9c83dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/72d56e93579d</guid>
            <category><![CDATA[dispatcher]]></category>
            <category><![CDATA[cache-invalidation]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[jcr]]></category>
            <category><![CDATA[apache]]></category>
            <dc:creator><![CDATA[Kaikubad]]></dc:creator>
            <pubDate>Mon, 28 Aug 2023 09:08:11 GMT</pubDate>
            <atom:updated>2023-08-28T09:22:53.399Z</atom:updated>
            <content:encoded><![CDATA[<h3>Empower AEM performance by purging Dispatcher cache effortlessly from backend (servlets or services)!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RevxqdNT2pQsODHq7f0HRA.png" /></figure><p>As a shared understanding, we recognize the dual benefits of the dispatcher: firstly, orchestrating load equilibrium across multiple publish AEM instances, and secondly, the art of content caching. In this article we are not going to discuss about what is cache and how it works.</p><p>Our main goal is to clear dispatcher cache from aem backend (i.e: Servlet, Model, Services, Process). I will create a servlet here and show the implementation just to give you understanding. I will use this servlet form author instance, but it can be used on publish also.</p><p>First I will create an osgi configuration named <em>com.example.aem.internal.services.DispatcherConfigServiceImpl~example.cfg.json. </em>Here multiple dispatcher internal ip url is added.</p><pre>{<br>  &quot;isEnabled&quot;: true,<br>  &quot;dispatcherPaths&quot;: [&quot;http://1.2.3.4:80/dispatcher/invalidate.cache&quot;,&quot;http://{another_ip}:{port}/dispatcher/invalidate.cache&quot;]<br>}</pre><p>I have created <strong><em>DispatcherConfigService</em></strong> to read this osgi configuration.</p><p>Now create the following servlet for cache clean</p><pre>@Component(service = Servlet.class,<br>        property = {<br>                Constants.SERVICE_DESCRIPTION + &quot;=Example cache clean&quot;,<br>                ServletResolverConstants.SLING_SERVLET_METHODS + &quot;=&quot; + HttpConstants.METHOD_GET,<br>                ServletResolverConstants.SLING_SERVLET_PATHS + &quot;=&quot; + DispatcherCacheCleanServlet.SERVLET_PATH<br>        }<br>)<br>public class DispatcherCacheCleanServlet extends SlingSafeMethodsServlet {<br>    protected static final Logger logger = LoggerFactory.getLogger(DispatcherCacheCleanServlet.class);<br>    protected static final String SERVLET_PATH = &quot;/bin/private/example/cache/clean&quot;;<br>    @Reference<br>    private DispatcherConfigService dispatcherConfigService;<br>    private ResourceResolver resourceResolver;<br><br>    @Reference<br>    private RestClient restClient;<br><br>    @Override<br>    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {<br>        String[] dispatcherPaths = dispatcherConfigService.getDispatcherPaths();<br>        String path = &quot;/content/example&quot;;<br>        for (String dispatcherUri : dispatcherPaths) {<br>        try {<br>               Map&lt;String, String&gt; headerMap = new HashMap&lt;&gt;();<br>               headerMap.put(&quot;CQ-Action&quot;, METHOD_DELETE);<br>               headerMap.put(&quot;CQ-Handle&quot;, path);<br>               headerMap.put(&quot;Host&quot;, &quot;flush&quot;);<br>               headerMap.put(&quot;CQ-Path&quot;, path);<br>               headerMap.put(&quot;Referer&quot;, &quot;about:blank&quot;);<br>               ServerResponse serverResponse = restClient.postNoBody(dispatcherUri, headerMap, path);<br>               logger.info(&quot;result: &quot; + serverResponse.getResponseString());<br>           } catch (IOException e) {<br>               logger.error(&quot;Flush cache servlet exception: {} &quot; + e);<br>           }<br>        }<br>    }<br>}</pre><p>Here I have exposed the servlet to /bin/private<em> . </em>It can ba added as you needed. Here rest client is my own service for http request.</p><p>The basic thing is we are calling dispatcher endpoint for cache clean with root path. This is just a basic example. You can extend it more if needed.</p><p>Here AEM Author, publish and Dispatchers are in same internal network therefore they are accessible from each other. Dispatcher private ip won’t be accessible outside the author and publishers.</p><p>Publishers can be multiple and dispatchers can be multiple. Therefore I have showed two dispatcher url paths.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72d56e93579d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of Sling Dynamic Includes: A Deep Dive into Dynamic Content Rendering in AEM]]></title>
            <link>https://kaikubad.medium.com/unleashing-the-power-of-sling-dynamic-includes-a-deep-dive-into-dynamic-content-rendering-in-aem-9d8f62481656?source=rss-b297fd9c83dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d8f62481656</guid>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[sling-dynamic-include]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[sling]]></category>
            <category><![CDATA[aem]]></category>
            <dc:creator><![CDATA[Kaikubad]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 07:34:46 GMT</pubDate>
            <atom:updated>2023-08-24T07:34:46.472Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzR45lvmgX0WGGpxRKrW4A.png" /></figure><p>While working for a client recently, requested to find solution on content cache and experience fragment cache. We have a header component which is configured inside an experience fragment and then the experience fragment is configured on header section. And same goes for the footer section as well.</p><p>The main problem was the cache. The experience fragment was also getting cached with the page itself. So if new page is published/unpublished which has impact on header was not taking effect on the site. So we had three problems</p><ol><li>The experience fragment was getting cached with page.</li><li>Page publish/unpublish was not taking effect on pages because its already cached.</li><li>We don’t want to clear full cache. The site has a very large volume of traffic</li></ol><p>Our goal was to achieve the following</p><ol><li>We wanted to cache the experience fragment commonly. i.e: Experience fragment xyz will be cached once in one place and then it will be severed by the Sling Dynamic Include wherever its used.</li><li>Clear the cache of page and experience fragment on publish which is default behavior.</li></ol><p><strong>So what we did?</strong></p><p>We included Sling Dynamic Include and I will describe how we added it.</p><p>First we need to Download and install the <a href="https://sling.apache.org/downloads.cgi">Sling Dynamic Include bundle</a>.</p><p>The Jar <a href="https://dlcdn.apache.org/sling/org.apache.sling.dynamic-include-3.3.0.jar">Bundle Link</a> is added here. The go to the felix console of your publish instance. <a href="http://localhost:4503/system/console">http://localhost:4503/system/console</a> and click the install/update button on the right top. Browse the jar file you downloaded and click install. Don’t forget to check the Start Bundle and Refresh Packages checkbox. For reference please check the screenshot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*33corf15U2FzxaSpl6jncA.jpeg" /></figure><p>After the installation check if the bundle is active or not</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92CNN6wOEz2LBKG0O-3Xxw.jpeg" /></figure><p>Then go to <a href="http://localhost:4503/system/console/configmgr">http://localhost:4503/system/console/configmgr</a> and search for <strong>Apache Sling Dynamic Include Configuration</strong> and configure it like following screenshot. Or you can provide the osgi configuration from application code. There can be multiple configuration for different purposes. I have created configuration <strong>org.apache.sling.dynamicinclude.Configuration~example-xf.cfg.json</strong></p><pre>{<br>  &quot;include-filter.config.enabled&quot;:true,<br>  &quot;include-filter.config.path&quot;:&quot;/content/experience-fragments&quot;,<br>  &quot;include-filter.config.resource-types&quot;:[<br>    &quot;example/base/components/sdicontainer/v1/sdicontainer&quot;<br>  ],<br>  &quot;include-filter.config.include-type&quot;:&quot;SSI&quot;,<br>  &quot;include-filter.config.add_comment&quot;:true,<br>  &quot;include-filter.config.selector&quot;:&quot;xf&quot;,<br>  &quot;include-filter.config.required_header&quot;:&quot;Server-Agent=Communique-Dispatcher&quot;,<br>  &quot;include-filter.config.appendSuffix&quot;: true<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUKKrmSKHOS2Ff4tPebFJw.jpeg" /></figure><p>Here example/base/components/sdicontainer/v1/sdicontainer is the component for which we want to cache separately if its loading anything from /content/experience-fragments. We can also deny the cache so that it is always loading the updated things. Our plan is we will create only one cache file for each experience fragments on a separate path. Now change your experience fragments template structure to following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dP1wKIrSYdJnaHViIfuwTw.jpeg" /></figure><p>Now create an experience fragment page with the new modified structure and place it on a page with the experience fragment component. Everything from code level is done. But we still need to do some dispatcher changes.</p><p>Update Apache HTTPD Web server’s httpd.conf file to enable the Include module and load following module</p><pre>LoadModule include_module libexec/apache2/mod_include.so</pre><p>Now update the publish vhost file of your site</p><pre>    &lt;Directory &quot;${PUBLISH_DOCROOT}&quot;&gt;<br><br>    #sling dynamic include<br>    Options FollowSymLinks Includes<br>    ModMimeUsePathInfo On<br>    AddOutputFilter INCLUDES .html</pre><p>Also update the filter on your domains farm</p><pre>/filter {<br>        $include &quot;../filters/filters.any&quot;<br>        # allow expericene fragment      <br>        /0001 { /type &quot;allow&quot; /extension &quot;html&quot; /selectors &quot;xf&quot; /path &quot;/content/experience-fragments/*&quot; }<br>    }</pre><p>Now add the following rule to cache &gt; rules section</p><p><em>You can also deny the selector and extension if needed. In this case this will not cache and everytime it will be rendered in aem not from dispatcher cache. That means user will always have the updated component data. This can be any component you can add on the json config I have added earlier.</em></p><pre>/rules {<br>      $include &quot;../cache/ams_publish_cache.any&quot;<br>      ...<br>      ...<br>      /00025 {<br>          /glob &quot;*.xf.html*&quot;<br>          /type &quot;allow&quot;<br>      }<br>  }</pre><p>Now everything is done. Create experience fragment with the template we updated and configure it. Add more experience fragments as you needed. Use it on different pages. Now experience fragment will be cached on <em>/content/experience-fragments/</em></p><p>If the specific experience fragment is updated + published the cache will be cleaned automatically and all the pages using the same experience fragment will updated accordingly</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d8f62481656" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>