Cache configuration
Document Engine uses two types of cache to improve performance and reduce load on the asset storage backend:
- A local file system cache for PDF files fetched from the asset storage backend. This speeds up future access to the same files. Configure the cache size with
ASSET_STORAGE_CACHE_SIZE. - An in-memory cache for rendered pages requested by a Nutrient Web SDK client. This speeds up future rendering of the same pages.
These caches only work on a single Document Engine node; they aren’t shared across multiple nodes. If you need a shared cache for rendered pages across nodes, refer to the Redis cache section.
Clustering and caching
If you don’t use a shared cache, clustering helps by keeping requests for the same document on the same node. When you enable clustering, Document Engine routes document-scoped requests to a single owner node for each document. This means requests for the same document keep hitting the same node, so that node’s built-in caches stay effective even without Redis.
In a clustered deployment, each node owns only part of the total document set. Because of that, each node only needs enough local cache for its share of documents — roughly 1/n of the total working set in an n-node cluster.
This reduces per-node cache requirements compared to an unclustered multi-node deployment, where each node must be sized for the full working set. For sizing guidance, refer to the horizontal scaling guide.
If you’ve configured Redis, it still works as a shared cache across nodes.
Redis cache
Document Engine supports Redis as a shared cache for rendered pages. With Redis enabled, multiple Document Engine nodes can reuse rendered pages instead of rendering the same content again. This works only with Nutrient Web SDK.
If you’re deploying with Helm, you can set all Redis configuration options through values(opens in a new tab):
assetStorage: redis: # `USE_REDIS_CACHE` enabled: false # `REDIS_TTL` ttlSeconds: 86400000 # `USE_REDIS_TTL_FOR_PRERENDERING` useTtlForPrerendering: true # `REDIS_HOST` host: redis # `REDIS_PORT` port: 6379 # `REDIS_DATABASE` database: "" # Sentinels sentinel: enabled: false # `REDIS_SENTINELS` urls: [] # - "redis://sentinel1:26379" # - "redis://sentinel2:26379" # - "redis://sentinel3:26379" # `REDIS_SENTINELS_GROUP` group: none # `REDIS_USERNAME` username: "" # `REDIS_PASSWORD` password: "" # `REDIS_SSL` tls: enabled: false # External secret name externalSecretName: ""Manage and configure Redis separately, including:
- Setting a memory limit
- Setting an eviction policy
We recommend the allkeys-lru eviction policy for most use cases. For more information, refer to the guide on using Redis as a least recently used (LRU) cache(opens in a new tab).
When you move from a trial license to a production license, delete all cached data. This prevents trial overlays from appearing in production.
Compatibility
Document Engine supports:
- Single-node Redis deployments
- Redis Sentinel deployments
Redis cluster mode isn’t supported. Use Redis 2.2.0 or newer.
Prerendering
Refer to the documentation for the prerendering endpoint to learn how to render and cache documents in advance and reduce document load times.