How to Optimize Web Server for Faster Response Time (Critical for Business Growth)
- Learn to perform Code Profiling in Visual Studio (if you develop in ASP.Net or C#)
- Find out what Store Procedure gets called too often and optimize them for performance (Create Indexes on database tables)
- 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).
- Run your Web Application on Google's Page Speed Insights to get more details on optimization
- 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.
- 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.
- "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).