Open kolaf opened 2 months ago
The track may change after the fact if the administrator uploads a gpx file or reverts back to the live data.
The speed of the live tracking map frontend is been significantly improved. We have not implemented cdn yet, not sure if this is required.
Frontend api redesign
Existing implementation
To summarize, initial loading is done via rest and all subsequent updates are pushed via the websocket. The track for contestant will never be modified after it has been received, but the score and score log may be changed after the fact by the contestant administrator if there were any errors in the scoring.
Considerations for a new implementation
The most important thing is to cache the static files (especially the frontend since it is quite large) and the contestant tracks. Contestant tracks can never be altered, but they will typically be updated every second with a new position as long as the contestant is flying. Changing to a model where the websocket only pushes notifications about data and having the front end fetch the updated data via rest seems like a good approach to reduce load on the real time system.
The simplest approach is to cache contestant tracks indefinitely with a one second resolution, which leads to 1800 HTTP requests for half an hour of data. This seems excessive. Having larger slices, e.g. 5 seconds, means that the last slice will be incomplete and should not be cached which leads to higher server load. However, retrieving five positions should not pose a big imposition on the server.
The score and score log may be altered after the flight which means it cannot be cached indefinitely or for a significant time. It appears to be possible to explicitly invalidate a CDN cache, but it looks like this is not advisable.