Best practices
The networking theory we discussed in the previous section is the starting point for the best practices we are going to overview in the following pages. We will go through networking software architectures and patterns to follow to improve the client-server communication of our application to enhance the user's understanding of the speed of our applications.
Latency gauging
We said initially that there is no way to predict the timings for a remote request to the server. This is always true, but we can somewhat estimate its duration by tracing our requests' timings and by calculating the average value. This particular process can be helpful to define different strategies depending on latencies. For example, if the response for a particular remote resource is fast, we can expect that, in the same connectivity conditions, this will still be fast.
Moreover, we can then change the request and ask for more than in a slower response case. The classic example is image resolution: if...