# Handling concurrency on the Web with Web Locks API

DevFeed: [Handling concurrency on the Web with Web Locks API](<https://devfeed.tech/articles/handling-concurrency-on-the-web-with-web-locks-api-20386.md>)

Original publisher: [Read original article](<https://tech.olx.com/handling-concurrency-on-the-web-with-web-locks-api-163b7e07eddd?source=rss----761b019b483f---4>)

Author: Cesar Contreras

Published: 2026-07-14T15:36:00Z

Content type: tutorial

Language: en

Sources: [OLX](<https://devfeed.tech/sources/olx.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Web](<https://devfeed.tech/topics/web.md>), [API](<https://devfeed.tech/topics/api.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [browser](<https://devfeed.tech/tags/browser.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [locks](<https://devfeed.tech/tags/locks.md>), [react](<https://devfeed.tech/tags/react.md>), [resumable-file-upload](<https://devfeed.tech/tags/resumable-file-upload.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>), [web](<https://devfeed.tech/tags/web.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>), [web-development](<https://devfeed.tech/tags/web-development.md>)

## AI overview

This article explains concurrency on the web through the Web Locks API. It describes an OLX upload scenario involving files up to 20GB, where uploads should resume after a browser or tab is reopened without requiring the user to remain in the web app. It identifies multiple tabs resuming the same upload simultaneously as a cause of duplicate uploads, wasted bandwidth, extra processing costs, and unpredictable progress.

## Source excerpt

Image by the_iop from Pixabay Concurrency in programming is the ability to manage and execute multiple tasks or processes at the same time (or appear to), allowing programs to remain responsive and efficient. Think of it like a chef in a busy kitchen: they're not cooking every dish from start to finish sequentially, but instead chopping vegetables while one pan simmers and another bakes; juggling progress on several tasks concurrently. I'm a frontend engineer at OLX working mostly with React and NextJs, but I also came from a background in which I worked primarily in concurrent programs with Java. Creating multi-threaded applications can be a pain, dealing with locks, semaphores... and my favorite... deadlocks (very scary in large codebases). Once I transitioned fully to Web development, I never imagined I would have to deal with scenarios like this, and then here I am writing my first article about it. Web development has turned into a very powerful ecosystem, from the previous era where the web was only about flashy animations using HTML marquee (a bit of sarcasm here 😆), dominated by JQuery, to a really powerful environment where you can use Workers, 2D and 3D animations with WebGL and Canvas, offline capabilities with Service Workers, and the list continues. This is evidence that the Web can now face really complex challenges, and it's just a matter of time before you have to face similar ones. The problem Recently, at OLX, we faced the challenge of working with large file size uploads. Providing the best user experience is tricky when it comes to handling uploads, and most of the real use cases out there require the user to stay in the web app until the upload completes, but we didn't want that. Since we are working with large file sizes (up to 20GB), we want the user to be free and do other stuff while this is uploading, so if the user closes and opens the browser or tab, the upload should continue with no manual intervention. For this, we had to provide a mechani