Override default timeout?

Hello! We’re noticing long initial timeouts (the retry strategy is working great now when it does time out) for some of our assets and we’d like to adjust those. I’ve tried a lot of different things, but I can’t seem to get at the underlying _xhr.timeout, which is set to 0, without changing Bablyon’s code directly.

A couple of things I’ve tried in our code:

WebRequest.timeout = 14;

WebRequest.prototype.timeout = 27;

Unfortunately, these don’t modify the xhr timeout.

If I go into Babylon’s WebRequest send method and set this._xhr.timeout = 22 there, it works, but overriding the send method is probably not the best way. Is there an existing way to change the default timeout that I’m missing? Thank you!

I think you can probably use addEventListener checking for OPENED state and then set the timeout there.

1 Like

I’ll give that a try – thank you! Would it be helpful for me to also open a pull request adding timeout to the configurable properties and methods in WebRequest?

1 Like

I don’t see any reason why not. Open the PR and we will see what people say. :slight_smile: