2.8 KiB
| title | status | type | priority | created_at | updated_at | blocked_by | |
|---|---|---|---|---|---|---|---|
| Verify API worker gzipped binary size is within CF Workers free tier (3 MB limit) | completed | task | normal | 2026-03-10T23:32:06Z | 2026-03-10T23:32:14Z |
|
This ticket verifies that the API worker stays within that limit once all Cargo.toml dependencies are pinned (ticket 1f5bb5). No structural changes are expected — the release profile and architecture already make this highly likely.
Key facts:
- Worker size limit: Free = 3 MB (gzipped), Paid = 10 MB (gzipped)
Cargo.tomlrelease profile already hasopt-level = "z",lto = true,strip = true,codegen-units = 1wranglerapplieswasm-opt -Ozautomatically during build- The API Worker contains only API code (no Yew/UI); UI runs on Cloudflare Pages
- Database layer uses
workers-rsD1 bindings (not SQLx) — avoids a heavy dep
Step 1 — Build the release worker bundle
From the quotesdb/ directory, after ticket 1f5bb5 has added all Cargo.toml dependencies:
wrangler deploy --outdir bundled/ --dry-run
This produces output like:
Total Upload: 523.41 KiB / gzip: 147.23 KiB
The gzip: figure is the size that counts against the 3 MB free tier limit.
Step 2 — Evaluate the result
| Gzip size | Action |
|---|---|
| < 2 MB | No action needed. Note the size in this ticket. |
| 2–3 MB | Note the size. Add a comment to track future dep additions carefully. |
| > 3 MB | See remediation steps below. |
Step 3 (conditional) — Remediation if > 3 MB
Try in order:
-
Audit dependencies — run
cargo bloat --release --cratesto identify the largest contributors. Remove or replace heavy crates (e.g., swapchronofortime, avoid fulltokiofeatures). -
Explicit
wasm-optpass — ifwrangleris not applyingwasm-optfor some reason:wasm-opt -Oz -o output.wasm input.wasm -
Workers Paid plan — if the binary genuinely cannot be reduced below 3 MB, upgrade to the Workers Paid plan ($5/month, 10 MB limit). Update
infra/resources accordingly and document the decision indocs/ARCHITECTURE.md.
Step 4 — Document outcome
Record the final gzipped size in docs/ARCHITECTURE.md under the API section, and close this ticket.
# From quotesdb/ directory:
wrangler deploy --outdir bundled/ --dry-run
# Confirm "gzip: X KiB" is < 3 MB (3072 KiB)
`chore(quotesdb): verify api worker binary size within cf workers 3mb free tier limit`