How to Cache Images in Your Expo App

DavidDavid November 23, 2026 8 min read
A blank smartphone on a wooden desk beside neatly stacked printed photographs and a small wooden card-catalog drawer in soft morning light
Original image, App Store Launch Club

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

ValueWhat it doesWhen to use it
'disk' (default)Reads from the disk cache if the image is there, otherwise downloads it and saves it to diskFeeds, avatars, product photos, almost everything
'memory-disk'Keeps the image in memory with the disk cache as a fallbackImages 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 memoryA high-resolution image rendered many times on one screen
'none'No caching at allImages 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)

PlatformHow long images staySize limit
Android (Glide)Cached images do not expireUp 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 terminatesNo limit by default. Set one with Image.configureCache({ maxDiskSize })
WebFollows your server's cache headersThe 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.

  1. 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.
  2. 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.
  3. 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

PropWhat it does
placeholderImage shown while the real one loads: a blurhash, thumbhash, local image or URL
placeholderContentFitHow the placeholder is sized. Defaults to 'scale-down', which differs from contentFit and can cause a jump. Set it to match contentFit
transitionA number is the cross-dissolve duration in milliseconds, for example transition={200}
transition.skipOnCacheHitAndroid and iOS. 'memory' or 'all' shows cached images instantly instead of fading them in every time
recyclingKeyAndroid 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.

Free app-building tips, straight to your inbox

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

David

Written by

David

Founder and app builder

Keep reading

ExpoClaude Code

How to Add Notification Actions to Your Expo App

To add notification actions to an Expo app, register a category with Notifications.setNotificationCategoryAsync, give it action buttons (and optionally a text reply), set categoryIdentifier on the notification, then read response.actionIdentifier in a response listener. Here is every action option, how to handle taps when the app was closed, the Android and iOS differences, and a Claude Code prompt that wires it all up.

David 8 min
Read article
ExpoClaude Code

How to Schedule Local Notifications in Your Expo App

To schedule local notifications in an Expo app, install expo-notifications, set a notification handler, ask for permission, create an Android channel, then call scheduleNotificationAsync with your content and a trigger like DAILY, WEEKLY or DATE. Here is every trigger type, how to cancel and list what is scheduled, why Android reminders arrive late, and a Claude Code prompt that builds the whole reminder flow.

David 8 min
Read article

Ready to build it yourself?

Join App Store Launch Club, the #1 community for building and launching apps, for $9/month.

← Back to the blog