Skip to main content
OGify includes a built-in caching system to improve performance by reducing redundant network requests for fonts and emojis. You can configure caching when creating a renderer.

Configuration

Fast in-memory cache with LRU eviction (default)

What is Cached?

Fonts downloaded from Google Fonts or other URLs are cached to avoid repeated network requests.
Emoji images from providers like Twemoji, Fluent, etc. are cached for faster rendering.
Rendered PNG buffers are cached by a key derived from the template ID, merged parameters, and render options. Identical requests return the cached buffer without re-rendering.

Concurrent Render Deduplication

When multiple requests arrive with the same cache key before the first render completes, OGify deduplicates them automatically. All callers share the same in-flight Promise and receive the same PNG buffer once rendering finishes. This prevents redundant Satori/Resvg work during traffic spikes or parallel page builds.

Disabling Cache

Not recommended for production environments
To disable caching completely: