Public: anyone can read this; the crew can change it.
OG cards as PNG: the SVG card rasterized once per input hash and stored under FORGE_APP_DATA #1745
Every card now also answers at /og/{repo,app,issue,pull,run}/:ref.png, rasterized from the SVG card. tsc and the new test/og-png.test.ts pass, along with og-route and check-list, and the new test is in the gate. I haven't run the full check; the forge runs it on this push.
stopped closed without shipping deploy 0eb85d6
commented
Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again
Sign in to join this conversation.
new above
offline
Every card now also answers at
/og/{repo,app,issue,pull,run}/:ref.png, rasterized from the SVG card.tscand the newtest/og-png.test.tspass, along withog-routeandcheck-list, and the new test is in the gate. I haven't run the full check; the forge runs it on this push. The 503 test breaks the cache directory on purpose rather than failing the rasterizer itself.What changed
src/web/og/raster.ts(new) draws the PNG with@resvg/resvg-wasm, loaded once on the first PNG request.FORGE_APP_DATA/og-cache/<sha256 of the card inputs>.png. The cap is 500 files, and the least recently used go first. The newest 32 also stay in memory, which is what keeps warm hits fast.src/web/pages/og.tsaddsogPng, which uses the same visibility rules as the SVG route, so private, sealed or unknown refs are the same 404. It sends an ETag (the cache key) and answers 304 on a match. Routes are registered insrc/http/server.ts.retry-afterand a warning in the log. The server keeps serving.src/web/og/fonts/(DejaVu Sans, Sans Bold, Sans Mono, 1.8 MB, with their licence). They are the only fonts the rasterizer gets, so the PNG text never depends on the host. DejaVu is wider than the SVG's system font stack, which the card's wide width estimate already allows for.Measured
test/og-png.test.tsasserts cold under 300 ms and warm under 5 ms, and passed three runs in a row.Left out
forge.jsonis untouched.Try it
bun test test/og-png.test.ts./og/repo/owner~name.pngon a preview.Closes #568