DEV Community

Discussion on: fetch with a timeout

Collapse
 
stereobooster profile image
stereobooster • Edited

This is very good question, which I haven't asked myself - blind spot in my brain, because I got used to it.

I guess you need timeout on client-side, if server timeout is longer than you want. For example you need to upload big files to this server and as the result timeout of all endpoints increased, not just one.

The second case, is if you guard against slow network. For example 2G connections or if your server is in Europe, but users are in Australia or Japan.

And maybe you actually right and we don't need it in first place. I just thought - "hey, everybody is doing it with timeout, but without cancel. Let me share this"