Image Delivery#
HTMLPix serves images through signed URLs on Cloudflare's edge network. Here's how the flow works.
The flow#
- Your backend calls
POST /v1/urlto mint a signed URL. - You place the URL in your page's
<meta property="og:image">tag. - When a crawler or browser requests the URL, the image is rendered and cached at the edge.
- Subsequent requests for the same URL are served directly from cache.
Why signed URLs#
- API keys stay private — only your backend talks to the minting API.
- URLs are crawler-safe — no auth needed to fetch the image.
- CDN-friendly — deterministic URLs map to consistent cache keys.
- Billing at mint time — you know your costs upfront. Fetches are free.
Response headers#
Successful image responses include:
| Header | Description |
|---|---|
Cache-Control | public, max-age=86400 (24 hours) |
ETag | Content hash for conditional requests |
X-Cache | r2 (served from cache) or render (freshly rendered) |
Server-Timing | Render duration in ms (fresh renders only) |
Cache invalidation#
Signed URLs are long-lived (5 years by default). To invalidate the cache after updating a template:
- Mint new URLs — updated templates get a new
tv(template version) parameter, which creates a different cache key. - Old URLs continue to serve the previous version until they expire.