Virus

Link preview cards on Cloudflare's free plan

2026-10-14

Drawing preview cards live cost more CPU than a free-plan request gets. Drawing them at build time fixed it without giving anything up.

ogee, my link-preview tool, draws a card for every page: title, colors, fonts and logo, rendered by takumi as WebAssembly inside the Worker. On a paid plan that's fine. On the free plan, this site hit error 1102: the request ran out of CPU time while drawing.

Draw once, serve forever

The pages on this site only change when I deploy, so their cards can too. The build now renders every card to an image, and the Worker answers card requests with that file. A page without a prebuilt card still falls through to live drawing, so nothing breaks if I forget one.

ogee render --out dist/_cards

What I took from it

If something only changes on deploy, do the work at build time. The free plan stays free, the cards come back instantly, and the live path is still there for the pages that really are dynamic.

<a href="/contact">Start a project</a> or <a href="/book">book a call</a>.