Optimizing Daily API Calls in AEM: A Better Solution?
In my current AEMaaCS setup, I’ve created a scheduled Sling job to make daily calls to an external API, storing the API response in the repository at /var/api-data. Here’s a breakdown of how it works:
- A scheduled job runs once a day to call the external API.
- The API response is stored under /var/api-data, which minimizes the daily load on the API server.
- A custom service reads this data from /var/api-data, making it accessible to the Sling Model, which then provides the data to the frontend components.
This setup has effectively reduced API calls and ensured data availability throughout the day.
However, I’m curious if there might be a more efficient or best-practice approach within AEM for this type of implementation. Are there other strategies for handling scheduled API data updates in AEM that could offer improved performance, persistence, or scalability?