JS HttpAgent.create timeout

Today I’m experiencing IC overload and it is a good opportunity to handle this in my apps.
But actually for the best user experience I’d like to display message after 10 seconds of waiting.
At this monent it throws errors after a very long peroid - many minutes. From user’s point of view it looks like frozen app.

I see there is some idle timeouts already but what about first connection timeout?

Most popular error message is:
Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
icp-api.io/api/v2/canister/ryjl3-tyaaa-aaaaa-aaaba-cai/read_state:1

You can try to implement and pass a custom backoff strategy as backoffStrategy option while creating a HttpAgent instance.

The default strategy seems to have an exponential backoff with a timeout at 5 minutes, it can be found here: agent-js/packages/agent/src/polling/strategy.ts at main · dfinity/agent-js · GitHub