Looking for some advice on how to structure an app I want to try.
The end result is a number of charts, which are based on data retrieved from a number of APIs. The data is to be retrieved every 24 hours and some calculations will be applied (moving averages etc).
What I want to avoid, is the data being retrieved/calculations being done every time someone loads a page. I want the data/calcs done, and charts updated at a fixed time, and then when someone loads a page the chart is instantly there.
Would I be able to get away with global variables here?
So a dcc.Interval component set to every 24 hours, and that callback retrieves data, applies calcs, and creates/updates global figures for each chart. In my layout, my dcc.Graph components would use the global figures?
The data would be static once updated i.e. the app/user does not modify the data in any other way.
Any thoughts would be appreciated - thank you!