client libraries not loading intermittently on dispatcher url | Community
Skip to main content
Level 3
June 25, 2024
Solved

client libraries not loading intermittently on dispatcher url

  • June 25, 2024
  • 5 replies
  • 1614 views

Hi all,

 

We are migrating the website from AMS to AEMaaCS. 

As part of refactoring, we have moved the clientlibs to /apps/<project>/clientlibs.

We have set allowProxy = true and allowed clientlibs from dispatcher filter also.

 

On dispatcher, we have observed that sometimes the requested pages are loading all clientlibs and icons. At some times, pages are broken due to clientlibs not being loaded.

 

Need help in troubleshooting the root cause of the same.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by h_kataria

My guess is that CDN is serving cached HTML which has references to some older version clientlibs which is probably why this is intermittent. 
Once the CDN cache expires this issue must be getting resolved.
Both clientlibs and HTMLs should have proper Cache-control/Surrogate-control headers. 
For e.g from the screenshot I see cache-control header has max-age directive twice which should be fixed.
Whenever this issue comes, you can check for the Age and X-Cache response header in your browser for your HTML as well as clientlibs to validate the caching behaviour. Till that doesn't expire as per your set TTLs you will continue to get stale HTML/clientlibs and possible 404s. 

Check this https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching#html-text and 
https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching#content-consistency to understand better. But this is just a guess, there could be other factors associated as well.

5 replies

MukeshYadav_
Community Advisor
Community Advisor
June 25, 2024

If intermittent issue is for same page then we may try to debug for cache issue.

Debugging with query params which does not get cached will ensure cached pages are not served and help in conclusion.

Ref:- https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/clientlibs-not-loading-properly-on-dispatcher/td-p/683144

Level 3
June 25, 2024

We tried with query params also. Even with query params also, sometime the client libs are loading fine and sometimes not.

pulkitvashisth
Community Advisor
Community Advisor
June 25, 2024

@pardeepg4829047 There are a few things you can try to debug above issue:

1. You can check with query params : As you said that adding the query params also doesn't help and the intermitted issue persists. Then you can compare the response headers of the pages that are working fine and those where clientlibs are breaking.

2. Also when you say clientlibs are breaking, what does that mean?
Are the clientlibs not being called only? 
Or, Are the clientlibs' calls returning some HTTP error? If so can you share what is the response from the network tab to help you further.

3. Also please check in the request.log and access.log to check the clientlib calls and see if there are any permission issues, or if the calls are getting filtered out by dispatcher rules. 

Level 3
June 25, 2024

The clientlibs throw 404 error intermittently.

See attached screenshot:

 

 

 

MukeshYadav_
Community Advisor
Community Advisor
June 25, 2024

Hi @pardeepg4829047 ,

Seems very subjective and intermittent so its tough to figure out. However you may try https://teamtreehouse.com/community/encountering-a-neterraborted-error-and-404-error-when-refreshing-page-within-3-nested-routes as this error was also on refresh only.

If somewhere in the nested structure path can be simplified in build/compilation

 

Thanks,

h_kataria
Community Advisor
Community Advisor
June 25, 2024

If it is inntermittent, then can you also provide a screenshot when you received a successful response of this pall-iconset.ttf ?

Level 3
June 26, 2024

For successful response, the clientlibs are loading properly as shown below

 

 

 

 

h_kataria
Community Advisor
h_katariaCommunity AdvisorAccepted solution
Community Advisor
June 26, 2024

My guess is that CDN is serving cached HTML which has references to some older version clientlibs which is probably why this is intermittent. 
Once the CDN cache expires this issue must be getting resolved.
Both clientlibs and HTMLs should have proper Cache-control/Surrogate-control headers. 
For e.g from the screenshot I see cache-control header has max-age directive twice which should be fixed.
Whenever this issue comes, you can check for the Age and X-Cache response header in your browser for your HTML as well as clientlibs to validate the caching behaviour. Till that doesn't expire as per your set TTLs you will continue to get stale HTML/clientlibs and possible 404s. 

Check this https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching#html-text and 
https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/content-delivery/caching#content-consistency to understand better. But this is just a guess, there could be other factors associated as well.

Level 4
June 25, 2024

hi @pardeepg4829047 ,

Hope you have found a solution for this. If not , few pointers worth trying if possible

  1. Assuming the filters in dispatcher are configured correctly as this is working intermittently.
  2. Can you please check if its related to permissions. I think anonymous user should also have permissions to /etc
  3. Are you trying the dispatcher url or the CDN. Please reach out to Adobe support on the cache configuration set at CDN and to flush the cache.

Thanks,

Anil

kautuk_sahni
Community Manager
Community Manager
July 8, 2024

@pardeepg4829047 Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you! 

Kautuk Sahni