Expand my Community achievements bar.

[AEM Gems] Mastering Cache Efficiency for Optimal Page Performance

Avatar

Administrator

kautuk_sahni_0-1742954775947.jpeg

Session Details

In a world where speed and efficiency are paramount, mastering the art of cache optimization is crucial for delivering a superior user experience. This session is designed to provide you with actionable strategies and techniques to enhance your cache efficiency. Join us to explore practical methods for implementing effective caching strategies, optimizing cache hit ratios, and fine-tuning your cache configurations.

Session Recording -

Speaker(s)

Chaya Sudindrakumar - Sr. Manager at Adobe, Joerg Hoh - Lead Site Reliability Engineer at Adobe & Shubham - Expert CSME at Adobe

Session Presentation - https://adobe.ly/MCE 

 

Session Q&A

In an AEM Headless setup, what mechanism is used to invalidate cached content fragments in the Dispatcher? Do we need to configure anything additional to ensure cache invalidation when a content fragment is republished?
 
What happens if only a referenced content fragment is updated, while a persistent query is used to fetch the top-level content fragment (which is not republished because it hasn’t changed)? Will the cache still be invalidated in that case?
Handling Updated Referenced Content Fragments
When a referenced content fragment is updated, but the top-level content fragment is not republished, the situation becomes more complex:
 
Persistent Queries and Cache: If a persistent query is used to fetch the top-level content fragment, and only a referenced fragment is updated, the cache may not automatically invalidate for the top-level fragment. This is because the top-level fragment itself hasn't changed or been republished, which means the flush agent doesn't trigger an invalidation for that specific cache entry.
 
Explicit Invalidation: In such cases, explicit cache invalidation might be necessary. This could involve configuring custom invalidation scripts to ensure that updates to referenced fragments trigger cache invalidation for any related top-level fragments. Alternatively, adjustments to your cache invalidation strategy may be required to account for changes in referenced content source.
Which logs we have to upload here for on-prem installations ? CDN or Dispatcher logs ? The analysis tools and scripts provided in the "AEMCS-CDN-Log-Analysis-Tooling" repository are generally tailored for CDN logs in the context of AEM as a Cloud Service. If you're working with Dispatcher logs, you might need to adapt these tools or develop custom scripts to parse and analyze the Dispatcher log format effectively.
There are cases where we cannot cache pages, like when you post data to a page. What are your suggestions in such cases for an optimal performance? Such an approach has 2 downsides: Such requests always need to go to the origin, which can add a significant network latency to these requests; and secondly you can scale audience only by scaling the origin system. While you should strive to deliver as much as possible from the CDN, I understand that this is not always possible. But then try to minimize the impact for both enduser and origin, for example by just load the relevant information via JSON from origin and do a browser-layer integration; instead of loadind an entire page, where 98% of the content is static.
How is CDN performance calculated on the Cloud Manager dashboard? Is it HIT/(HIT+MISS+PASS)? yes, it's HIT / (HIT+MISS+PASS). 
 Is the ELK solution only for offline analysis, right? What are the options for a live log analysis? For example, say to generate alarms when ratio oder coverage goes bad and you don't want to check hours or days later. Please check this document: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/dev... 
 Would you say it's advisable to avoid caching in Fastly when onboarding your own CDN? Team can avoid caching in Fastly when using your own CDN, this decision should be carefully considered based on your specific needs, performance goals, and resource availability for managing the CDN setup. 
 What or how do we categorize hit-pass https://www.fastly.com/documentation/reference/vcl/variables/miscellaneous/fastly-info-state/ 
 Is a long cache invalidated with every deployment, or is it invalidated once every 24 hours (or similar - it creates new image from the gold node) on AEMaaCS? In both the cases cache is cleared. 
 Is a long cache invalidated with every deployment, or is it invalidated once every 24 hours (or similar - it creates new image from the gold node) on AEMaaCS? In both the cases cache is cleared. 
 In case of custom CDN, will OOTB Fastly CDN honor any cache-control settings defined in a vhost config or it will just pass them to custom CDN and act as a passthrough for all requests and responses? Fastly will also honor the regular cache-control settings, unless there is also a "surrogate-cache-control" header which will override this setting. 
 How can we clear the image, pages or clientlibs CDN cache? Please check this document: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/con... 
Can LocationMatch directive to set cache control be created as a separate file for reuse purpose across multiple vhost?  yes; this is possible. 
 How can we enhance the caching mechanism to better handle sensitive or personalized content? Probably your security will disallow you to cache sensitive information at the CDN level at all. For personalized content it depends on your definition of personalized. If you personalize in the sense of targeting, it's probably not a problem at all, because all of this is content is public. If you need to deliver content which requires authentication and possibly also authorization, you probably will need to deliver it consistently from the origin (both for simplicity of the architecture and also for security reasons). Also the value of caching this data at the CDN level is questionable, because you are likely to serve that individual file for exactly 1 user. 
 Are there any references for CDN config with Edge delivery services ?
- There are vendor-specific setup steps on that page.
 


Kautuk Sahni
10 Replies

Avatar

Community Advisor and Adobe Champion

@Jagpreet_Singh_ We might need to update this with a recording link as the event is already over and the recording link on the registration page redirects to this page.

 

 

Avatar

Administrator

Hi @gkalyan thank you for this  - I have updated the post - i am facing issues to upload the video. I have uploaded the session presentation at the moment. 

Avatar

Community Advisor and Adobe Champion

Thank you @Jagpreet_Singh_ The link seems to be gated. Not able to access it.

 

Avatar

Administrator

Can you check now @gkalyan 

Avatar

Community Advisor and Adobe Champion

It works. Thanks @Jagpreet_Singh_ 

Avatar

Administrator

you are welcome @gkalyan 

Avatar

Level 4

Able to access the link. Thank you.

Avatar

Community Advisor

The attached link is taking to gated page. Can you provide the session recordings ?

Avatar

Administrator

Can you check now @VeenaVikraman 

Avatar

Level 2

Thanking you for the session material.