I have the following stack in my project:
Cronjobs are running every 15 minutes to populate the MySQL database with data from the API. At the same moment, the flask app renders this date. So, everytime an user visits the website, the table containing a big quantity of data is loaded. The request is made to the database to load the data. The data will be presented in the bootstrap table as a response.
I'd want users to be able to refresh the table data (by clicking on the refresh
button) and always view the most recent data (rather than having to wait for the cronjob to restart and update the database).
If I trigger to import the data from the API again whenever the user clicks on the refresh
button, the operation will be extremely time consuming, and the entire data will be loaded for a number of minutes before the page can be shown again. What is the best way to refresh table data that has been loaded from the database?