<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6" -->

---
title: Speeding up Expensify's networking with NitroFetch
description: A detailed case study on migrating Expensify's React Native app to NitroFetch, a drop-in fetch() replacement built on Nitro Modules that routes requests...
canonical: https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Speeding up Expensify's networking with NitroFetch | daily.dev
og:description: A detailed case study on migrating Expensify's React Native app to NitroFetch, a drop-in fetch() replacement built on Nitro Modules that routes requests...
og:url: https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6
og:image: https://api.daily.dev/og/posts/9aRh53Bt6.png
og:image:alt: Speeding up Expensify's networking with NitroFetch
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Speeding up Expensify's networking with NitroFetch

**[Nitro Modules](https://daily.dev/sources/margelo)** · 15 min read · 2 upvotes · 1 comments

## Summary

A detailed case study on migrating Expensify's React Native app to NitroFetch, a drop-in fetch() replacement built on Nitro Modules that routes requests through Cronet on Android and URLSession on iOS. Beyond the straightforward global fetch replacement, the integration covered startup prefetching of the critical ReconnectApp request via prefetchOnAppStart, native token-refresh for authenticated prefetches, account-scoped prefetch keys to avoid leaking cached responses across sessions, and reimplementing certificate pinning against Cronet since it doesn't inherit OkHttp or Android Network Security Config pins. Results: average request duration dropped 15-30%, and warm startup P50 improved by 267ms (15.93%) on iOS and 650.5ms (20.18%) on Android.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://margelo.com/blog/speeding-up-expensifys-networking-with-nitro-fetch>

## Questions this post answers

### How much faster is react-native-nitro-fetch compared to the built-in React Native fetch implementation?

Average request duration dropped by roughly 15-30% across request types and network conditions when Expensify migrated to react-native-nitro-fetch, which routes requests through Cronet on Android and URLSession on iOS instead of the default React Native networking stack. Startup request completion also improved: P50 fell 267ms (15.93%) on iOS and 650.5ms (20.18%) on Android when native prefetching was enabled alongside the migration.

_Teams weighing a networking stack migration can track real-world benchmarks like this on daily.dev before committing engineering time._

### Why doesn't certificate pinning configured for OkHttp automatically work after switching Android networking to Cronet?

Cronet owns its own TLS stack on Android and does not inherit certificate pins configured through React Native's OkHttp client or Android's Network Security Configuration file. Apps that rely on certificate pinning must implement a separate pinning layer and patch it into the new engine, since switching transport libraries silently drops previously enforced pins.

_Developers auditing transport-level security after a networking library swap can follow gotchas like this via daily.dev._

### How can startup network requests be prefetched before the JavaScript bundle finishes loading in a React Native app?

NitroFetch's prefetchOnAppStart function lets native code persist a request and fire it on the next cold start before the JavaScript runtime is ready, using a matching prefetchKey to link the native response to the later fetch() call in JavaScript. On iOS this happens automatically; on Android it requires calling AutoPrefetcher.prefetchOnStart before React Native loads in Application.onCreate().

_Engineers optimizing app startup latency can find implementation patterns like native prefetching through daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 0 upvotes

> During a logout race, I'd switch accounts between native startup and JavaScript hydration. The test can let the old prefetch complete after the switch. The cache should still contain only the new account's data.

## Similar posts on daily.dev

- [Next.js for the Next Billion Users: Optimizing for High-Latency Markets](https://daily.dev/posts/next-js-for-the-next-billion-users-optimizing-for-high-latency-markets-nbxhqfay2) · SitePoint · 1 upvotes · 0 comments
- [From skeptic to convert: how Fieldy adopted Expo for their AI wearable](https://daily.dev/posts/from-skeptic-to-convert-how-fieldy-adopted-expo-for-their-ai-wearable-q783wl8vk) · Expo Blog · 0 upvotes · 0 comments
- [From latency to instant: Modernizing GitHub Issues navigation performance](https://daily.dev/posts/from-latency-to-instant-modernizing-github-issues-navigation-performance-t1jb6lu6h) · GitHub Blog · 14 upvotes · 1 comments
- [The App Is Just the Tip: What It Takes to Build Mobile Infrastructure at Scale](https://daily.dev/posts/the-app-is-just-the-tip-what-it-takes-to-build-mobile-infrastructure-at-scale-ss3plj7wx) · InfoQ · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#networking](https://daily.dev/tags/networking), [#react-native](https://daily.dev/tags/react-native)

[View this post on daily.dev](https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Speeding up Expensify's networking with NitroFetch","url":"https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6"},"datePublished":"2026-08-25T17:21:25.735Z","dateModified":"2026-09-13T21:49:00.383Z","description":"A detailed case study on migrating Expensify's React Native app to NitroFetch, a drop-in fetch() replacement built on Nitro Modules that routes requests...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a2cbf0e8d6cc3fd8bf67721f319ad03b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a2cbf0e8d6cc3fd8bf67721f319ad03b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Nitro Modules","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Nitro Modules","logo":"https://media.daily.dev/image/upload/s--5qrQGNNm--/f_auto,q_auto/v1787487502/logos/margelo?_a=BAMAMicg0","url":"https://daily.dev/sources/margelo"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"performance,networking,react-native","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nitro Modules","item":"https://daily.dev/sources/margelo"},{"@type":"ListItem","position":3,"name":"Speeding up Expensify's networking with NitroFetch"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6","comment":[{"@type":"Comment","text":"During a logout race, I’d switch accounts between native startup and JavaScript hydration. The test can let the old prefetch complete after the switch. The cache should still contain only the new account’s data.","datePublished":"2026-08-30T07:23:43.204Z","url":"https://daily.dev/posts/9aRh53Bt6#c-nsFoUHIfF","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/speeding-up-expensify-s-networking-with-nitrofetch-9arh53bt6#faq","mainEntity":[{"@type":"Question","name":"How much faster is react-native-nitro-fetch compared to the built-in React Native fetch implementation?","acceptedAnswer":{"@type":"Answer","text":"Average request duration dropped by roughly 15-30% across request types and network conditions when Expensify migrated to react-native-nitro-fetch, which routes requests through Cronet on Android and URLSession on iOS instead of the default React Native networking stack. Startup request completion also improved: P50 fell 267ms (15.93%) on iOS and 650.5ms (20.18%) on Android when native prefetching was enabled alongside the migration. Teams weighing a networking stack migration can track real-world benchmarks like this on daily.dev before committing engineering time."}},{"@type":"Question","name":"Why doesn't certificate pinning configured for OkHttp automatically work after switching Android networking to Cronet?","acceptedAnswer":{"@type":"Answer","text":"Cronet owns its own TLS stack on Android and does not inherit certificate pins configured through React Native's OkHttp client or Android's Network Security Configuration file. Apps that rely on certificate pinning must implement a separate pinning layer and patch it into the new engine, since switching transport libraries silently drops previously enforced pins. Developers auditing transport-level security after a networking library swap can follow gotchas like this via daily.dev."}},{"@type":"Question","name":"How can startup network requests be prefetched before the JavaScript bundle finishes loading in a React Native app?","acceptedAnswer":{"@type":"Answer","text":"NitroFetch's prefetchOnAppStart function lets native code persist a request and fire it on the next cold start before the JavaScript runtime is ready, using a matching prefetchKey to link the native response to the later fetch() call in JavaScript. On iOS this happens automatically; on Android it requires calling AutoPrefetcher.prefetchOnStart before React Native loads in Application.onCreate(). Engineers optimizing app startup latency can find implementation patterns like native prefetching through daily.dev."}}]}
```

