~/swaraj.dev
Back to all posts
March 19, 20261 min read

Image Caching Made Easy with react-native-fast-image

Leverage react-native-fast-image to cache remote assets, cut network churn, and keep scrolling buttery‑smooth on both iOS and Android.

react nativeperformanceimage caching

Insight

Remote images are a hidden performance killer in React Native apps—each scroll can trigger a new HTTP request, causing jank and wasted data. react-native-fast-image replaces the default Image component with a native‑backed view that implements aggressive caching, priority loading, and automatic memory management. By declaring a cache policy per‑image you can keep frequently used assets on‑device for the app’s lifetime, dramatically reducing load times and network usage.

Example

import FastImage from 'react-native-fast-image';

export default function Avatar() {
  return (
    <FastImage
      style={{ width: 80, height: 80, borderRadius: 40 }}
      source={{
        uri: 'https://example.com/user/avatar.png',
        priority: FastImage.priority.high,
        cache: FastImage.cacheControl.immutable,
      }}
      resizeMode={FastImage.resizeMode.cover}
    />
  );
}

Takeaway

Set cache: FastImage.cacheControl.immutable for assets that rarely change, and use priority to surface above‑the‑fold images first. Pair this with a small placeholder (defaultSource) to avoid layout shifts, and you’ll see smoother lists and lower data consumption without extra code.