How to Optimize Web Server for Faster Response Time

How to Optimize Web Server for Faster Response Time (Critical for Business Growth)

  1. Learn to perform Code Profiling in Visual Studio (if you develop in ASP.Net or C#)
  2. Find out what Store Procedure gets called too often and optimize them for performance (Create Indexes on database tables)
  3. Consider implementing a Caching System like Redis or Varnish to save static or data faster. (Study shows that Databases should only be used for data storage and reads should be performed from the Cache System. Reading from Cache is 10 times faster than Databases). 
  4. Run your Web Application on Google's Page Speed Insights to get more details on optimization
  5. On the Server Side, implement a System that logs Application Layer logs and evaluates those errors. When coding, try by all means to avoid Exception Handling (Try-Catch code blocks), not only does this slows down the application response time but it is also bad practice because Developers tend to not solve the problem instead of handling the Exception. The best way is to log the Exception and follow up with code implementation after the error.
  6. Find the most used Web Pages and optimize them by analyzing the Critical Rendering Path, for example here is how the Browser Works:
    - Html is passed first, when the Browser finds a CSS tag, it then evaluates whether that CSS tag is critical to the Rendering Path, if yes it then requests that file from the Web Server. Execution continues until the Browser finds another script tag, it then evaluates whether the script has an "async" tag that causes the Browser to request that tag on a different thread. However, with HTTP/2 now becoming optimal for HTTP Request the Browser requests these assets much faster.
    -After the requests of those files has been issued, the Browser continual to build the DOM Tree Structure then when the CSS and JavaScript files arrive from the Server, it goes on to construct the Painting Layer that paints to the UI.
  7. "Time To First Byte" is when the Server does not respond within 600ms, at that the Browser indexes your Web Application as slow and Data for Browser Analytics propagates. Make sure that the Web Server responds within time range by increasing the cache time (how long the Browser can invalidate the cached assets).