What is Web Worker?
Turkish: Web Worker
A Web Worker lets JavaScript run CPU-heavy tasks in a background thread separate from the main UI, keeping pages responsive.
What is a Web Worker?
A Web Worker lets JavaScript run in the browser without blocking the main UI thread. Large data processing, file parsing, image conversion, or complex calculations can happen in the background while scrolling and clicking remain responsive.
How It Works
The main script starts a worker file and communicates with it through postMessage. A worker cannot access the DOM directly. It sends results back to the main thread, and the main code updates the screen. For large data, transferable objects or SharedArrayBuffer can reduce copying cost.
A dedicated worker serves one page context, while a shared worker can be used by multiple tabs. A service worker has a different role around offline caching and network proxying. Async code organizes waiting, but it does not move CPU-heavy work off the main thread by itself.
Business Use
Web workers are useful for browser-side CSV or Excel parsing, large table filtering, map data processing, image compression, and encryption. In SaaS dashboards, they help local computation happen without making the interface feel frozen.
Workers are not needed for every task. For small jobs, messaging overhead can outweigh the benefit, and teams still need to handle errors, build configuration, and browser memory usage.
Related Terms
Asynchronous programming keeps applications responsive by running network, file, and other waiting work without blocking execution.
Intersection ObserverIntersection Observer is a browser API that asynchronously detects when an element enters or leaves the viewport or a chosen container.
Service WorkerA service worker is a browser script that runs separately from the page, intercepting requests to manage caching, push, and offline behavior.