Expectation
This means that the browser expects the server to process the request and return a response.
When this time is long, this usually means that the server side of the script takes a long time to process the request.
There are many reasons why the server side of the script is slow, for example. long-term database query, huge file processing, deep recursions, etc.
To fix this, you need to optimize your script. Besides optimizing the code itself, an easy way to reduce the execution time for subsequent requests is to implement some kind of caching on the server side.
Reception
This means that the browser is receiving a response from the server.
If this time is long, it means that your network connection is slow or the received data is too large.
To reduce this time, you need to improve the network connection and / or reduce the size of the response.
Reducing the size of the response can be performed by compressing the transmitted data, for example. by including gzip and / or removing unnecessary characters, such as spaces from the output, before outputting the data. You can also choose a different format for the returned data, where possible, for example. use JSON instead of XML for data or directly return HTML.
Generally
To reduce latency and receive time, you can implement some client-side caching, for example. by setting appropriate HTTP headers such as Expires , Cache-Control , etc. Then the browser will only make small requests to check if there are new versions of the data to retrieve.
You can also completely avoid requests by storing data on the client side (for example, by storing it in local or session memory) instead of retrieving it from the server every time you need it.