Workflows and Flush Agent | Adobe Higher Education
Skip to main content
Level 3
March 21, 2024
解決済み

Workflows and Flush Agent

  • March 21, 2024
  • 4 の返信
  • 1417 ビュー

Hi,

 

As per my client request, they want me to create a Widget (Custom Component) that get real time APIs from the Client database. After we have gotten that API data, I want to use Workflow and Flush Agent to clear cache of that Widget (Custom Component) so that the Widget displays the latest data from the API. I want the Workflow and Flush Agent to run at 2:00PM, 2:03PM and 2:05PM everyday. 

 

I was wondering how I could go about doing that. If anyone has any tutorials and resources about how to feasibly complete the requirements mentioned above would be greatly appreciated.

Thank you

Sching

このトピックへの返信は締め切られました。
ベストアンサー ChanuteJo

Hi,


Thank you all for the solutions. All these solutions have helped us a lot with coming up with the solutions. Me and my team has been able to find the solution to work. So we created a simple workflow. Then we use Scheduler and set a CRON Expression to run at 2PM everyday and setting the path to that specific page and now we are able to achieve the outcomes we wanted.

 

Best Regards

Sching

4 の返信

sateaswa94
Level 3
March 21, 2024

Hi @chanutejo 

I would recommend you to implement sling dynamic include so that particular component alone won't be cached as part of the page and always displays real time data.

https://experienceleague.adobe.com/en/docs/experience-manager-learn/foundation/development/set-up-sling-dynamic-include

Level 2
March 21, 2024

Hi @chanutejo 

Ideally, You should not cache this component at the dispatcher level. To implement dynamic caching of a component, one of the solutions could be using Sling Dynamic Include.

However, if you want to go ahead with your solution, you can write a scheduler that can trigger the workflow and flush agent programmatically.

Regards,
Arpit Varshney

DPrakashRaj
Community Advisor
Community Advisor
March 21, 2024

I would suggest you to consume the API data from the frontend side so that app is not cached and it will get fresh data on each request. That’s how normally we do. 
I believe file data are cached on dispatcher so you need to identify the pages on which the component is authored and you can setup a corn expression on dispatcher to execute the cache flush. This might not work if you are on AEMCaS. Sling dynamic include help but in case the request will still go to your aem server to get the api response but from front end you can avoid the backend call. Check below blog to how do a flush programmatically https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-call-flush-agent-programmatically-for-flushing-referenced/m-p/279850

MayurSatav
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
March 25, 2024

@chanutejo , Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

ChanuteJo作成者回答
Level 3
March 27, 2024

Hi,


Thank you all for the solutions. All these solutions have helped us a lot with coming up with the solutions. Me and my team has been able to find the solution to work. So we created a simple workflow. Then we use Scheduler and set a CRON Expression to run at 2PM everyday and setting the path to that specific page and now we are able to achieve the outcomes we wanted.

 

Best Regards

Sching