Plate № 08 · Routing design
A pattern from the gf.cx specimen book
Tag-router · numeric + slug peers
"QR-encoded asset tags need to be dense — a phone camera reads /1042 faster than /sennheiser-hd-560s-headphones — and re-assignable: the physical tag number outlives the asset description. But humans need friendly URLs they can type, share, and remember. Choosing one forces a compromise on the side you didn't pick."
The problem
QR-encoded asset tags need to be dense (a phone camera reads /1042 faster than /sennheiser-hd-560s-headphones) and re-assignable (the physical tag number outlives the asset description). But humans also need friendly URLs they can type, share, and remember. Choosing one over the other forces a compromise on the side you didn't pick.
Both numeric and slug forms are first-class peers in the Worker — neither is a redirect to the other. Both resolve directly to the same record:
// io.gf.cx/found Worker
GET /1042 → render record #1042
GET /ford-transit-van → render record (slug-looked-up) #1042
GET /1042.json → JSON projection of same record
The numeric ID carries class-prefixed structure for cheap human grouping (1xxx = vehicles, 2xxx = tools, 5xxx = electronics) without leaking the actual category into URL semantics — the prefix is a hint, not a contract.
The element, in-page
Tag chips for both forms of three real asset classes — click either row. Both forms serve the record directly with no intermediate redirect. The resolved card shows the canonical numeric ID, its slug peer, and the class-prefix hint.
Where it applies
- Use when assets carry physical QR tags that outlive their description — the numeric ID persists on the tag; the slug changes with each re-assignment without invalidating the printed code.
- Use when you want memorable URLs alongside scan-optimised ones — the slug peer is the shareable form, the numeric is the durable scan target.
- Skip when the asset set is small enough that a numeric ID is already human-readable, or when there is no need for a QR scan path at all.
- Skip when the slug must be stable over time — if a slug can be re-assigned to a different record, sharers of the old slug land on a different asset. Slug peers work best when they are descriptive aliases, not stable identifiers.
Reusable elements
- Dual-route Worker handler — one handler block per form; numeric hits a KV numeric index, slug hits a KV slug index, both return the same record shape. No
Response.redirect()between them. - Class-prefix numeric scheme — 1xxx / 2xxx / 5xxx grouping baked into the ID at assignment time. Cheap human triage, zero routing logic (the Worker does not branch on prefix).
- Canonical-at-render — the resolved HTML page emits
<link rel="canonical" href="/numeric-id/">regardless of which form was requested. Search engines see one URL; the user keeps whichever form they used. - Tag chip pair — a numeric chip (blue border, blue mono text) paired with a slug chip (muted border) in the same row. Active state fills both chips of the resolved pair, so the equivalence is visually immediate.
- JSON projection route —
/1042.jsonreturns the same record as a machine-readable projection. Useful for integrations that need the canonical ID without parsing HTML.
Reference
- Source
- Dan, 2026-06-22 · io.gf.cx/found asset tag system; extended to svc.gf.cx service records.
- In use / example
- io.gf.cx/found — gf.cx lost-property and asset-tag recovery surface; KV-backed, numeric + slug peers live, QR codes on physical tags resolve to both forms.
- Also in use
- svc.gf.cx — service-record QR labels with brand-keyed slug + numeric ID; the same dual-route Worker pattern applied to maintenance records.
- Reusable elements
- Dual-route Worker handler · class-prefix numeric scheme · canonical-at-render · tag chip pair · JSON projection route (listed above).
- Origin
- Asset tagging system design, 2026 — the constraint that physical QR codes must outlive the human-readable description of the thing they tag.