Server Response Time is the time it takes to begin rendering the page's information for the user. For example, whenever you click on a link, type in a site in the URL bar, or access a webpage, you are sending a request to a web server to allow you to view the site. The time involved in this process is called server response time. It is measured in Time To First Byte.
Time To First Byte (TTFB) means how many milliseconds of time it took between your request and the server's reply. There are three components involved in TTFB.
An HTTP request is triggered when the user initially loads the webpage. The server receives this request and provides an appropriate response. Factors such as network speed and the distance to the server can affect the time it takes for the server to receive the request.
When the server receives the request from the browser, it initiates various processes such as running scripts, fetching data from database and running back-end tasks.
Once all components of the response have been generated, the server sends it to the end user. This step is dependant on the performance of your website hosting server and the speed of the user’s internet connection.
Below are the some of the factors to be considered to improve the server's response time. Server Response Time should be below 200 milliseconds.
Slow application logic
Slow database queries
Slow routing
Frameworks
Libraries
Identify the major tasks that the server should complete in order to return page content, and then measure how long each of these tasks takes. Once the longest tasks are identified, search for the ways to speed them up.
Optimize the server's application logic to prepare pages faster.
Optimize how your server queries databases, or migrate to faster database systems.
Upgrade your server hardware to have more memory or CPU.
Optimize resources by combining files, minifying CSS and Javascript codes, and compressing images to decrease their file size.