[Answered ]-Asynchronous data fetching and cache handling

2πŸ‘

βœ…

A solution can be the following:
The view will serve cached results, when a task is completed this one will update the cached results with the fresh ones.
You can also use celery in this way here, when a cached view is hit and it has to be recalculated, a celery task get detached (the view will return the cached value).

Here there’s an interesting example about a one-at-time celery task:
http://ask.github.com/celery/cookbook/tasks.html

Leave a comment