Good morning,
I have Adome Aem on premise with 4 Publish machines.
I need to ensure that a portion of the page on a web page is not saved in the cache memory of the dispatcher servers.
I tried using experience fragments. When I edit and then publish the experience fragments it updates while the web page containing it does not, the cache memory relating to the web page of the dispatcher servers does not update.
How can I solve the problem.
Thank you
Solved! Go to Solution.
Views
Replies
Total Likes
If you have the challenge with implementing SDI i believe the option will be to use the client side approach . Setup an ajax request to a servlet endpoint or export the portion of page you need as part of model exporters in Json format . The particular request endpoint can be configured in dispatcher and CDN levels to no-cache and thus always you get the new result from server and render on the client side.
eg: under cache rules add something similar
/0104 {
# Exclusion for the dynamic content URL.
/glob "/xxx/xxx/xx*"
/type "deny"
}
You can use the sling dynamic include concept. Sling Dynamic Include (SDI) is a feature of Adobe Experience Manager that allows you to dynamically include fragments of content on a page.
Please read the below detailed implementation on how it can by pass the dispatcher cache and serve the dynamic content.
https://medium.com/@toimrank/aem-sling-dynamic-include-9c5eb233c33c
Hope this helps
HI,
Thanks for the reply.
But unfortunately I cannot use the Sling Dynamic Includes (SDI), the machines are shared with multiple projects, and I have not been authorized to install the new bundle.
Is there an alternative route?
Thank you
If you have the challenge with implementing SDI i believe the option will be to use the client side approach . Setup an ajax request to a servlet endpoint or export the portion of page you need as part of model exporters in Json format . The particular request endpoint can be configured in dispatcher and CDN levels to no-cache and thus always you get the new result from server and render on the client side.
eg: under cache rules add something similar
/0104 {
# Exclusion for the dynamic content URL.
/glob "/xxx/xxx/xx*"
/type "deny"
}
You can include your portion of page with plain Apache SSI directive instead of using SDI if you can't install it. It would be something like this in your html files
<div class='whatever'>
<!--#include virtual="${'/content/experience-fragments//whatever' @ selectors='nocache', extension='html'}" -->
</div>
You will need as well to ensure SSI will be interpreted by Apache by configuring this in your vhost
<Directory />
...
# Add Includes to enable SSI
Options FollowSymLinks Includes
...
</Directory>
Finally, you can add a dispatcher condition to not cache resource with 'nocache' selectors
/001 {
/glob "*.nocache.html*"
/type "deny"
}
SDI is the only way which allow not to cache portion of page. Playing with cache will not help as you will be writing on the basis of path which will not help as page names are dynamic.
Follow below URL having step by step process to implement
https://medium.com/@toimrank/aem-sling-dynamic-include-9c5eb233c33c