Cache NPE data (daily, 2x a day, etc.)

0
Hello,We have an interface that pulls data from an external system within an overview page on render for our users. Unfortunately, each time a user hits the page, the external data is consumed and mapped into a data grid of which the time to load can be a few seconds (spinner visible). Is there a workflow example or method that can cache the NPE data once a day, or timed cadence, instead of on entry-demand? In other BPM PaaS systems, service-backed entities would accomplish this desired behavior and looking for a similar construct in Mendix.JT
asked
1 answers
1

Yes, this is a common scenario in Mendix and you should not call the external service on every page load.


Instead of using the NPE directly on the page, the recommended approach is to cache the data in a persistable entity and refresh it on a schedule.


You can create a persistable entity (for example CachedData) and store the mapped results there. Then your page should read from this entity instead of calling the external service every time.


To keep the data up to date, use a Scheduled Event that runs daily or multiple times per day, depending on your need. This scheduled microflow should call the external service, map the response, and update the cached records in the database.


This way, users always see fast data from the database, while the external call runs in the background.


If you need more control, you can also use a Task Queue to refresh the cache asynchronously, especially if the data load is heavy.


In short, don’t use NPE directly for frequently accessed pages. Fetch once, store it, and serve it from the database.


If this resolves your issue, please mark it as accepted.


answered