Zum Inhalt springen

Process — OG image generation

Source: docs/superpowers/specs/2026-05-23-07-public-site-archive-design.md §5. Generates cdn.nowyourlink.com/og/daily/{date}.png via @resvg/resvg-wasm (per research/astro-cf-monorepo-patterns.md §1; deferred item in master §9 resolved here).

Scheduled jobs or the first image request check edge and object caches before rendering a social-preview PNG from day data. The result is stored for reuse. An administrator can invalidate cached images after a correction.Scheduled jobs or the first image request check edge and object caches before rendering a social-preview PNG from day data. The result is stored for reuse. An administrator can invalidate cached images after a correction.

Key invariants:

  • Resvg-wasm is loaded once at module scope; cold-start cost amortises across the worker isolate’s lifetime.
  • A KV mutex (og:lock:{date}, 10 s) prevents thundering herd on first hit.
  • Cloudflare Images is not used (master §10.2 cost discipline + research §1) — one PNG/day cached aggressively in R2 + edge.
  • The R2 object key is the cache key; admin purge deletes both R2 + edge cache atomically.