Skip to content
ferroseekdocumentation homemain, packages at version v0.1.0
Ferroseek on GitHub

Deploy to Cloudflare

A Ferroseek deployment is an ordinary Worker plus static assets: the compiled engine is bundled into the Worker script, and the index parts are uploaded as assets. The repository has no deploy script; you deploy with Wrangler directly.

You need a Cloudflare account that Wrangler is logged in to (npx wrangler login), and:

  1. The engine built for WebAssembly:

    npm run wasm:build
  2. An index in the Worker’s assets directory. For the standalone Worker that is worker/assets/index/:

    npm run index:build:100k
  3. Secrets, if the Worker should require authentication (standalone Worker only; see Run a standalone search Worker).

npx wrangler deploy --config worker/wrangler.jsonc

Wrangler uploads the Worker and the contents of worker/assets/. Because the configuration sets run_worker_first: true, the index files are reachable only through the ASSETS binding, not at a public URL. Observability is turned on in the same file, so request logs and CPU-time analytics appear in the Cloudflare dashboard.

Check it:

curl -s https://<your-worker>.workers.dev/

Deploy your own Worker the same way, from its directory or with --config pointing at its Wrangler file. Make sure the index is inside its assets directory at the path its assetsIndexSource reads, and that run_worker_first covers that path.

  • The first request in each new isolate loads the index. In the production measurement, loading took 226 to 313 ms and the first request 0.84 to 1.35 s in total.
  • The first request after uploading new index files was slower still: 4.5 s in the one measurement.
  • Memory after loading the 100k-product index was about 62 MB of the 128 MB isolate limit.

These are measurements of the proof of concept; see Performance for the conditions. If cold starts matter, send a request to new deployments before they take traffic.

Limit Value Why it matters
Static asset file size 25 MiB Index parts are at most 20 MiB
Isolate memory 128 MB Index plus your application plus per-request working memory must fit
Startup time of the Worker’s global scope about 1 s The index is therefore loaded on the first request, not at module load

Check Cloudflare’s current Workers limits for your plan.