# Moving hosted browsers to Cloudflare Browser Run — Rill

Source: https://userill.dev/blog/hosted-browsers-on-cloudflare

November 19, 2026 · The Rill Team

On November 18, six Rill browser jobs failed during video encoding and two failed at startup. We found empty capture files on the exe.dev VM that ran them. Its 25 GB disk had just 16 MiB free.

A ninth job failed because its URL contained a mistyped hostname. We decided to fix the storage problem by taking browser recording off the shared VM.

We’d already moved FFmpeg encoding for Chrome and CLI frame uploads to a three-container pool. A replacement encoder could finish an interrupted upload from the saved video, as we described in [our November 7 post about moving FFmpeg](https://userill.dev/blog/cloudflare-containers-video-encoding).

Hosted browser jobs still ran on exe.dev. When someone gave Rill a website and a task, the VM opened Chromium, followed the instructions and recorded the visit. Every new job had to write its footage to that same disk.

## Give the recorder a fresh browser

We started with one function that opens a fresh Chromium session on Cloudflare Browser Run and returns a Playwright page. Our agent could read headings and click buttons through an interface it already used. [Playwright on Browser Run](https://developers.cloudflare.com/browser-run/cdp/playwright/)

We tested session isolation with one value in local storage. It survived a reload during the job and was gone when the next browser opened the same site.

The agent, recorder and FFmpeg still needed somewhere to run. We put them in two on-demand Cloudflare Containers. A Worker saves each job in D1, our queue database. A Durable Object wakes the container assigned to it.

The runner claims one job, records into a fresh directory and sends the finished video to Cloudflare Stream for private playback. It then removes the temporary files.

## Time the first image

Both screenshot methods ran on Cloudflare Browser Run. From the same Node client we opened six fresh sessions per method. Each visited two small status pages we control. We alternated the page order and checked the title with every capture.

Playwright took the first batch of screenshots. In the second batch we asked Chromium for the visible page through the Chrome DevTools Protocol. Both methods used JPEG quality 65.

| Median time across six sessions per method | Playwright screenshot | Direct viewport JPEG |
| --- | --- | --- |
| From requesting a browser to receiving the first page image | 9.69 s | 6.11 s |
| From the next navigation to its image, in the same tab | 3.55 s | 1.44 s |

The first image arrived  **3.58 seconds sooner** , a 37% shorter wait in this benchmark. Once the tab was open, the next page and its image took  **2.11 seconds less** , a 59% reduction. All six second-page JPEGs matched the Playwright reference byte for byte.

The batches ran one after the other. The first-image times include variation in browser startup and network time. The second measurement starts with the tab already open.

## Start Chromium while the container wakes

In the standalone JPEG trials, acquiring a fresh browser and opening a tab took a median of 4.28 seconds. We set a target of 2.14 seconds for the time the production runner would spend waiting for that step.

Our first two cold production checks took 3.18 and 3.25 seconds for that step. The browser request went out after the container was ready. We had the Durable Object request Chromium as it woke the container, so the two could start together.

Only the assigned runner can claim that fresh browser, and it can do so once. Across six starts with stopped containers, the runner’s median wait for a usable page was  **1.16 seconds** . That saved about two seconds against the first two cold checks.

The clock for the first image starts earlier. For each cold trial we added the container’s wake time to the runner’s time to capture that image. The median was about  **7.04 seconds** . One container took 13.85 seconds just to wake.

## Check the last frame

We ran a browser check against a page with a button that changed its background color. Each check had to find the click and page request in the diagnostics and decode the finished video through its last frame.

All 21 checks in the verification set passed. Eight ran in pairs on two test containers. Those eight took a median of 5.21 seconds per job from the start of the check inside the runner through decoding the clip. A longer check decoded 62.85 seconds of changing video.

We routed two selected production jobs to Cloudflare, then enabled it for all eligible sites. The switch applied to new claims. A job already in progress finished with the worker that had picked it up.

All five production replays we checked on our own sites decoded to the end. At 15 seconds in one mobile replay, we could see a form reject a submission with “Add an amount greater than zero.”

The agent sent two invalid finish commands and the task ended inconclusively. We could still watch the recording and see exactly what the form did.

## Turn off the old workers

Our public Website to Video tool got a container slot of its own. It scrolls a page, encodes a silent MP4 and saves the video and poster in R2. A long capture there leaves both hosted browser slots available.

We played and downloaded a staging video before switching the public tool. Staging’s browser and encoding workers also moved to Cloudflare. On November 19, with both environments’ queues empty, we stopped all four Rill services on exe.dev.

With those services off, we asked Rill to read the heading on our status page. The runner had a browser in 0.87 seconds. Four seconds into the replay, we could read “Platform status” on screen, just as the agent had reported.

We also pasted our pricing page into the public tool. In 35 seconds we had a 22.3-second MP4 at 1280 × 720. We played it through the last of its 669 frames and downloaded the file. [Try Website to Video](https://userill.dev/tools/website-to-video).

## Where we’d look for the next second

One place to look is a container that’s already awake. In four such runs, the runner still waited a median of 3.47 seconds for a fresh browser. We’d try requesting Chromium as soon as the job is assigned, then measure from submission to the first frame.

There’s also time to save between clicks. In eight paired reads, fetching the page text and its controls in one browser round trip cut the median from 3.60 to 2.09 seconds. Both versions found the same 24 controls on our test pages.

We’d try that on longer tasks and measure whether the whole recording becomes playable sooner. If you’ve found a way to get the first frame on screen faster, we’d love to hear what you measured. [Share an idea with the Rill team](https://userill.dev/contact).
