First API request is extremely slow

In Production mode (only), the expo app’s first API request is extremely slow in Android device. After that first request, everything else is normal speed.

After a LOT of debugging and days of time spent, I found out that the actual request is fast, it just takes a full minute before the API request is “initiated”. Then once the request is initiated, other requests are normal.

It’s almost as if the app is locked because the JS code is running, but all animations and interactions are smooth.

What could be causing this issue?

1 Like

After further investigation, it seems this problem exists for 2015 Android devices. That or it’s just more common in older devices.

It’s also not consistent. Sometimes, the app is fast to open, other times it takes a full 40 seconds to get past the splash screen, then another 45 seconds+ for the first API request to be initiated.

Again, I’d like to reiterate the fact that the actual API request is fast (~1 second), but the actual Javascript code takes 45 seconds+ just to get triggered.

The app is simple, nothing complex. No heavy javascript or native activity happening on app start.

Does anyone think raw React Native (without Expo) could resolve this issue? Or would it make no difference?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.