---
title: "Optimize render cache performance in Nutrient"
canonical_url: "https://www.nutrient.io/guides/react-native/troubleshooting/outdated-render-cache/"
md_url: "https://www.nutrient.io/guides/react-native/troubleshooting/outdated-render-cache.md"
last_updated: "2026-05-15T19:10:05.056Z"
description: "Learn how to manage Nutrient's render cache to improve page display and avoid issues like flickering and stale images."
---

# Managing Nutrient's render cache effectively

Nutrient uses an internal render cache for speeding up page access times. When using the [`NutrientView`](https://www.nutrient.io/api/react-native/NutrientView.html) component, pages will be served from the internal cache, if available. Nutrient will keep track of changes to the document and will invalidate the render cache if necessary.

## How caching works

In most situations, Nutrient uses an in-memory cache of page renderings. When using the cache (which is the default), Nutrient will generate a unique cache key for every page it renders. If, for a specific cache key, there’s already a rendered image inside the cache, it’s served directly without rerendering.

## What causes the cache to become stale?

While Nutrient tries to detect changes to a document to avoid a stale cache, there’s a set of scenarios in which you have to manually tell Nutrient to invalidate its caches. In most situations, an outdated or stale render cache will cause page display issues, such as flickering of the displayed page or wrong thumbnail images in the thumbnail bar.

Typical operations that will cause an outdated render cache include:

- Reusing the same URI or file path for loading different documents.

- External changes to a previously opened PDF document — for example, adding annotations to it.

- Externally replacing a PDF document — for example, restoring an older version of the PDF.

- Deactivating [auto save](https://www.nutrient.io/api/react-native/NutrientView.html#.disableAutomaticSaving) and manually saving the `PDFDocument` instance.

When performing any of the listed operations, Nutrient won’t be able to detect file changes. In these cases, a manual cache invalidation should be performed.

## Manual cache invalidation

You can invalidate the cache, which forces a rerendering of pages, by using one of the following methods available on the [`PDFDocument`](https://www.nutrient.io/api/react-native/PDFDocument.html) instance:

- [`invalidateCacheForPage()`](https://www.nutrient.io/api/react-native/PDFDocument.html#.invalidateCacheForPage) will invalidate the cache for a single page of a given document.

- [`invalidateCache()`](https://www.nutrient.io/api/react-native/PDFDocument.html#.invalidateCache) will invalidate the render cache for an entire document, including all of its pages.
---

## Related pages

- [Guide to adding a Nutrient license key in React Native](/guides/react-native/troubleshooting/add-license-key.md)
- [Android Gradle Plugin Requires Java 11](/guides/react-native/troubleshooting/android-gradle-plugin-requires-java-11.md)
- [How to find your iOS app bundle ID easily](/guides/react-native/troubleshooting/finding-the-bundle-id.md)
- [Find out your Nutrient version easily](/guides/react-native/troubleshooting/getting-the-currently-used-version.md)
- [Fixing Android back button crash with Nutrient](/guides/react-native/troubleshooting/handling-back-navigation-with-react-native-screens.md)
- [Nightlies](/guides/react-native/troubleshooting/nightlies.md)
- [Fix new architecture build issues in React Native](/guides/react-native/troubleshooting/new-architecture-build-issues.md)
- [Out Of Memory Error React Native Android](/guides/react-native/troubleshooting/out-of-memory-error-react-native-android.md)
- [NutrientView inside a modal is blank or crashes on Android](/guides/react-native/troubleshooting/nutrientview-modal-android.md)
- [React Navigation](/guides/react-native/troubleshooting/react-navigation.md)
- [Textinput Error React Native Android](/guides/react-native/troubleshooting/textinput-error-react-native-android.md)
- [View controller-based status bar appearance](/guides/react-native/troubleshooting/view-controller-based-status-bar-appearance.md)
- [Understanding bundle IDs for iOS app development](/guides/react-native/troubleshooting/what-is-a-bundle-id.md)
- [Understanding app IDs in Android development](/guides/react-native/troubleshooting/what-is-an-app-id.md)
- [CMake/Ninja build error caused by long file paths on Windows](/guides/react-native/troubleshooting/windows-path-length-cmake-error.md)
- [Fix Xcode error code 65 for React Native on M1 Macs](/guides/react-native/troubleshooting/xcode-error-65-missing-required-target-architectures-react-native.md)

