Use Cases and Limitations
Know when workers help and what they cannot do.
What Workers Are Good For
Web Workers shine when you have CPU-heavy work that would otherwise freeze the UI:
- Image and video processing
- Parsing large files (CSV, JSON)
- Cryptography and hashing
- Physics, data analysis, and simulations
No DOM Access
The biggest limitation: workers cannot touch the DOM. There is no document or window. They compute data and send it back; the main thread updates the UI.
// Inside a worker:
// document.querySelector(...) -> ReferenceError
// Workers have no DOM at all.All lessons in this course
- Creating a Web Worker
- Messaging with postMessage
- Transferable Objects
- Use Cases and Limitations