---
title: "Document Engine cache configuration | Nutrient"
canonical_url: "https://www.nutrient.io/guides/document-engine/configuration/cache/"
md_url: "https://www.nutrient.io/guides/document-engine/configuration/cache.md"
last_updated: "2026-05-25T18:42:17.703Z"
description: "Document Engine uses two different kinds of caches to improve performance and reduce the load on the asset backend."
---

# Cache configuration

Document Engine uses two different kinds of caches to improve performance and reduce the load on the asset backend.

## Built-in caches

- When Document Engine needs to access a PDF file via the [asset storage backend](https://www.nutrient.io/guides/document-engine/configuration/asset-storage.md), the document is cached on the local file system to speed up future access. You can configure the size of the cache using the `ASSET_STORAGE_CACHE_SIZE` variable.

- When a Nutrient Web SDK client requests a document, Document Engine renders the individual pages and provides them to the client. These pages are cached in memory to speed up future rendering.

Since both caches only work for a single Document Engine node and aren’t shared across multiple Document Engine nodes, you can use Redis to enable a shared cache.

## Redis cache

Document Engine supports usage of Redis as a shared cache for rendered pages. This allows multiple Document Engine nodes to share their work, since only one has to render a document and others will be able to access the cached results. Be aware that this only works with Nutrient Web SDK.

If you’re deploying with [Helm](https://www.nutrient.io/guides/document-engine/deployment/helm.md), all [configuration options](https://www.nutrient.io/guides/document-engine/configuration/options.md#rendering-cache-options) can be set through [values](https://github.com/PSPDFKit/helm-charts/blob/master/charts/document-engine/values.yaml):

```yaml

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: ""

```

Note that you also have to manage and configure Redis. This includes setting the memory limit and setting an eviction policy. We recommend the `allkeys-lru` eviction policy for most use cases. Check out this guide on [using Redis as an LRU cache](https://redis.io/topics/lru-cache) for more information.

When moving from a trial license to a production license, we also recommend deleting all cached data, as this will prevent trial overlays from showing up in production.

Document Engine is compatible with any Redis version newer than 2.2.0.

Document Engine only supports single-node Redis deployments and Redis Sentinel deployments. Document Engine cannot be configured to use Redis in cluster mode.

## Prerendering

Refer to the documentation on the [prerendering endpoint](https://www.nutrient.io/api/reference/document-engine/upstream/#tag/Documents/operation/prerender-document) to find out how you can render and cache documents in advance to speed up the loading of your documents even more.
---

## Related pages

- [Certificate trust settings](/guides/document-engine/configuration/certificate-trust.md)
- [How to configure custom fonts in Document Engine](/guides/document-engine/configuration/custom-fonts.md)
- [Support large documents](/guides/document-engine/configuration/large-documents.md)
- [Asset storage configuration](/guides/document-engine/configuration/asset-storage.md)
- [Configuration options](/guides/document-engine/configuration/options.md)

