Why You Need Background Tasks
Keep requests fast by deferring slow work.
The Slow Request Problem
Some work is slow: sending email, resizing images, calling other APIs. If a view does it inline, the user just stares at a spinner. 🐢
Requests Should Be Fast
A good web request returns in milliseconds. Anything that takes seconds blocks the browser and ties up a Django worker that could serve someone else.
All lessons in this course
- Why You Need Background Tasks
- Setting Up Celery with a Broker
- Writing and Calling @shared_task
- Scheduled Jobs with Celery Beat