In one of my client assignments that involved developing mobile web application, WebWorker was used to load large amount of data during the initial page load. The code that ran as a worker thread performed multiple AJAX calls and loaded the data and gave it to the UI thread which stored it in Web Sql database and consumed it whenever required. When the Worker thread was running in the background, the UI thread was busy constructing the layout components like accordion, lists etc.,
WebWorker has support from the latest versions of many browsers. It has to be used judiciously as it supposedly consumes a lot of memory.
In the next few posts let’s discuss the use of WebWorker API with simple examples.