Currently quiz statistics are computed on demand and then cached. This means that:
a) there is a significant cold start when a user asks for statistics and they result is not already cached
b) if a user completes a quiz and looks at statistics they will not see the results of their just-completed quiz
As an alternative it would be good to rerun the computation every time a quiz is completed.
This should not be done on the submit completion request but rather just started there (ideally later this will be on a worker but we don''t have one yet).
This should also be done on application start so the cache is already hot
The cache expiry should be removed or made very long (as it's now invalidation on completion it should not get out of date)
Currently quiz statistics are computed on demand and then cached. This means that:
a) there is a significant cold start when a user asks for statistics and they result is not already cached b) if a user completes a quiz and looks at statistics they will not see the results of their just-completed quiz
As an alternative it would be good to rerun the computation every time a quiz is completed.