How to cache images in your Expo app, in short
Run npx expo install expo-image, then replace import { Image } from 'react-native' with import { Image } from 'expo-image' and pass your URL as the source. That is the whole setup. expo-image stores every image it loads from a URL in a disk cache by default, so the second time a user opens that screen the picture comes from the phone instead of the network. The package is included in Expo Go and needs no permission.
Everything else in this guide is about controlling that cache: choosing where images are stored, refreshing an image that changed on your server, warming the cache before a screen opens, and hiding the gap while an image loads. If your feed of profile photos or product shots feels slow and flickers on every scroll, this is the fix.
Step 1: Swap in expo-image
expo-image is a drop-in image component built on SDWebImage on iOS and Glide on Android. Beyond caching, it supports WebP, AVIF, HEIC, animated GIFs and SVG, and it can cross-fade between images when the source changes so you stop seeing that flash of empty space.
The props you will use most are source, style, contentFit and cachePolicy. contentFit replaces resizeMode and mirrors CSS object-fit, with 'cover' as the default. The old React Native props such as resizeMode, defaultSource and fadeDuration still work for easier migration, but they are deprecated, so let the swap be a chance to move to contentFit, placeholder and transition.
Step 2: Pick a cachePolicy
cachePolicy decides where an image is stored. The default is 'disk', which is the right choice for almost every remote image in an indie app.
expo-image cachePolicy values
| Value | What it does | When to use it |
|---|---|---|
| 'disk' (default) | Reads from the disk cache if the image is there, otherwise downloads it and saves it to disk | Feeds, avatars, product photos, almost everything |
| 'memory-disk' | Keeps the image in memory with the disk cache as a fallback | Images you show again and again in one session, like a header or your own avatar |
| 'memory' | Memory only. The memory cache can be purged very quickly to avoid running out of memory | A high-resolution image rendered many times on one screen |
| 'none' | No caching at all | Images that must always be fresh, like a live camera snapshot or a signed URL |
The memory cache only lasts while the app is running. The disk cache survives restarts, which is what makes a returning user's feed appear instantly.
How long images actually stay cached
This is the part most tutorials skip, and it explains most 'my image will not update' bugs. On Android and iOS, the disk cache does not follow the Cache-Control or Expires headers your server sends. Each platform has its own rule.
Disk cache behavior by platform (expo-image, SDK 58)
| Platform | How long images stay | Size limit |
|---|---|---|
| Android (Glide) | Cached images do not expire | Up to 250 MB, then the least recently used images are removed |
| iOS (SDWebImage) | Removed after the app has not read them from disk for one week. Cleanup runs when the app goes to the background or terminates | No limit by default. Set one with Image.configureCache({ maxDiskSize }) |
| Web | Follows your server's cache headers | The browser's HTTP cache decides |
Both phone platforms can also delete files from the app's cache directory when the device runs low on storage, so treat the cache as a speed boost, never as storage. If an image must be available offline no matter what, save it with expo-file-system instead. Our guide to adding offline support to your Expo app covers that.
On iOS, Image.configureCache also accepts maxMemoryCost and maxMemoryCount for the in-memory cache. When the disk cache is over the maxDiskSize you set, the least recently used images are removed until it is under half that limit. If your app shows a lot of large images, setting a disk limit is a reasonable way to keep the app's storage footprint down.
Step 3: Refresh an image that changed
Because the native cache ignores your server's headers, a user who changes their profile photo can keep seeing the old one if the URL stays the same. You have three ways out.
- Change the URL. Add a version query parameter, for example ?v=2 or the updated_at timestamp from your database. A new URL is a new cache entry.
- Set a cacheKey. Pass source={{ uri: url, cacheKey: `avatar-${user.id}-${user.avatarVersion}` }}. By default the cache key is the URL, so a custom key lets you control freshness without touching the URL, which helps with signed URLs that change on every request.
- Turn caching off for that image with cachePolicy='none'. Use this only for images that are always different.
To wipe everything, for example on logout, call Image.clearDiskCache() and Image.clearMemoryCache(). Both work on Android and iOS and return a promise that resolves to true when the clear succeeds.
Step 4: Prefetch images before the user needs them
Image.prefetch(urls) downloads images into the cache before any screen shows them. Call it with the first few images of the next screen while the user is still on the current one, and the next screen opens with pictures already in place.
Prefetched images go to memory and disk by default, so keep your Image components on 'disk' or 'memory-disk' to read them back. The promise resolves to true when every image is prefetched, and resolves to false straight away if any one of them fails, so do not treat false as 'nothing was cached'.
Two more helpers are worth knowing. Image.getCachePathAsync(cacheKey) tells you whether an image is on disk and where. Image.writeToCacheAsync(localUri, cacheKey) puts an image you already have on the device into the cache without downloading it. That is useful right after a user picks a photo with expo-image-picker: write it under the same cacheKey you will use for the uploaded version, and the new avatar shows instantly instead of waiting for the upload and a fresh download. Our guide to adding an image picker to your Expo app covers the picking part.
Step 5: Add placeholders and stop the flicker
Caching makes the second load fast. Placeholders make the first load look intentional. expo-image supports BlurHash and ThumbHash, short strings that decode into a blurry preview of the real image. Store one next to each image URL in your database and pass it as placeholder={{ blurhash }} or placeholder={{ thumbhash }}.
You can generate the strings in the app with Image.generateBlurhashAsync(url) or Image.generateThumbhashAsync(url), but the better pattern is to generate them once when the image is uploaded and save them, so every user gets the preview without extra work on their phone.
Props that control the loading experience
| Prop | What it does |
|---|---|
| placeholder | Image shown while the real one loads: a blurhash, thumbhash, local image or URL |
| placeholderContentFit | How the placeholder is sized. Defaults to 'scale-down', which differs from contentFit and can cause a jump. Set it to match contentFit |
| transition | A number is the cross-dissolve duration in milliseconds, for example transition={200} |
| transition.skipOnCacheHit | Android and iOS. 'memory' or 'all' shows cached images instantly instead of fading them in every time |
| recyclingKey | Android and iOS. Resets the view when the key changes so recycled list rows never show the previous row's image |
| priority | 'low', 'normal' or 'high'. A best-effort hint for which queued load starts first |
For a FlashList feed, the combination I would use is source={item.uri}, recyclingKey={item.id}, a blurhash placeholder and transition={{ duration: 200, skipOnCacheHit: 'all' }}. New images fade in once, images the user has already seen appear instantly when they scroll back, and no row ever shows someone else's photo for a split second.
Have Claude Code set it up for you
Open your project in the Claude Code desktop app and describe the result you want, including the cache rules:
Then add a line to your CLAUDE.md such as "Images: always CachedImage, never Image from react-native for URLs, cacheKey for signed URLs" so later sessions do not quietly bring back the old component.
The short version
To cache images in your Expo app, use the Image component from expo-image. It caches remote images on disk by default. Remember that the native cache ignores your server's headers, so refresh changed images with a new cacheKey or a versioned URL, prefetch the next screen, and add blurhash placeholders with skipOnCacheHit so your app feels instant on the second visit and polished on the first.
If you are building your first iOS app with Claude Code and Expo and want a second set of eyes before App Review, bring it to App Store Launch Club. Members share their builds and help each other get unstuck, and the curriculum covers the full path from first build to first users. Pair this with our guides to resizing images in your Expo app, adding offline support to your Expo app and reducing your Expo app size. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
How do I cache images in an Expo app?
Install expo-image with npx expo install expo-image and use its Image component instead of the one from react-native. Remote images are cached on disk by default because cachePolicy defaults to 'disk'.
Does expo-image cache images automatically?
Yes. With the default cachePolicy of 'disk', every image loaded from a URL is stored in a disk cache and reused on later loads. You can switch to 'memory-disk', 'memory' or 'none' per image.
Why is my Expo app still showing an old image after I updated it?
On Android and iOS, the expo-image disk cache does not follow Cache-Control or Expires headers, so the same URL keeps returning the cached copy. Add a version query parameter to the URL or set a new cacheKey on the source.
How long does expo-image keep cached images?
On Android, Glide keeps up to 250 MB and removes the least recently used images past that, and images do not expire. On iOS, SDWebImage removes images the app has not read for one week and has no size limit unless you set maxDiskSize with Image.configureCache. On web the browser cache follows your headers.
How do I clear the image cache in Expo?
Call Image.clearDiskCache() and Image.clearMemoryCache() from expo-image. Both work on Android and iOS and resolve to true when the clear succeeds.
How do I preload images in Expo?
Call Image.prefetch with a URL or an array of URLs. The images are cached to memory and disk by default, and the promise resolves to false straight away if any image fails to prefetch.
Does expo-image work in Expo Go?
Yes. expo-image is included in Expo Go, so you can test caching, placeholders and transitions without making a development build.
Last reviewed by David on November 23, 2026


