Caching
Pass cache_ttl (seconds, up to 7 days) on any render. The result is stored keyed by a
hash of the effective render parameters; any identical request inside the TTL returns the
stored bytes immediately.
{ "url": "https://example.com", "full_page": true, "cache_ttl": 3600 } The two things to know
- Cache hits are free. They don't count toward your monthly renders (you can see them as
cached_hitsin/v1/usage). The response headerx-rasterkit-cache: HIT|MISStells you what happened. - The key is exact. Any parameter change (even
quality: 81vs80) is a different cache entry.cache_ttlitself,async, andwebhook_urlare excluded from the key.
Patterns
| Use case | Suggested TTL |
|---|---|
| Link previews / unfurls | 86400 (1 day) |
| OG images for published posts | 604800 (7 days, the max) |
| Monitoring / visual diffs | 0 (always fresh) |
| Invoices / PDFs with unique data | 0 — every render is unique anyway |
HTTP caching is layered on top: cached-able responses carry Cache-Control: public, max-age=…, so browsers and CDNs can avoid hitting us at all.