4

I'm doing HTTP GET-requests from mobile devices (so network connection usually is not reliable) and wondering what would be a better approach:

  • Try 1 request with a timeout of 60 sec or
  • Try 3 requests each with a timeout of 20 secs

Or any other combination of retries/timeouts. I don't know if a HTTP/TCP connection actually can be stalled so a retry would be a good thing. I don't transfer a lot of data (< 1 kB) and are wondering what approach usually yields to a faster response time?

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
user1863617
  • 129
  • 1
  • 7

1 Answers1

0

As long as it's an idempotent operation, it should be OK to retry more frequently in theory. (a GET should never have any side effect at all, to be honest.) It might still put unnecessary load on the server, and delayed responses to multiple retransmits of the request may saturate the downlink and make the situation worse.

In interactive applications I find an honest "it's taking longer than normal" notification with a user-triggerable "retry" the best: The user has the option to press the "retry" button after exiting the tunnel or building that was causing a short network outage.

Conversely out in the woods with constantly low throughput, they will learn to ignore the notification and wait patiently.

Szocske
  • 7,466
  • 2
  • 20
  • 24