crowdin/mobile-sdk-ios

Duplicate requests and larger than expected response sizes

chrispomeroyhale opened this issue · 0 comments

Describe the bug
We are integrating the SDK for Over-the-Air functionality and we are noticing some additional network requests go out which leads to larger request sizes going out. Our app experiences a high volume of customers.

  1. On each app start we see 2-3 requests for manifest.json. This always returns HTTP 200 and is not cached. ~35KB response size each
  2. For each localization file we download we are seeing an initial HTTP 200 response. It is cached and compressed, which is great, ~50KB response size in our usage. But on a subsequent request when we get an HTTP 304 "not modified" we are still seeing that the TLS handshake costs 33KB.
  3. On a fresh app install I am also seeing two calls for the languages API. ~41KB in size each

This means each app start requires between ~200KB (expired cache) and ~65KB (fresh cache). Multiplied by all of our users 😅😰

To Reproduce
See above.

Expected behavior
I don't expect to see parallel or back-to-back requests in the same app session (1 & 3). I also am expecting the manifest.json to be cached (1). Additionally, it would be nice if we can reduce either the size of our 304 responses or rate limit them on the client (2).

Screenshots
200:
200

304:
304

In this demo project we have two localization files listed in our manifest, one significantly <1KB uncompressed and the other 77KB uncompressed. Fresh install at 18:12, quit and re-opened app at 18:14.
DuplicateRequestsAndLarge304Responses

Smartphone (please complete the following information):

  • Device: iPhone SE (sim)
  • OS: 15.2

Additional context