Improving Your Server Response Time: Every Millisecond Matters

Many website owners, webmasters, web developers and others have struggled to reduce their servers' response time to improve their website's performance. The reason for this is because everyone on the web wants a fast loading website. Speed matters and speed is the key.

Server response time is the amount of time it takes for a web server to respond to a request from a user's browser. This includes the time to load HTML for necessary rendering, subtracting out the network latency between users and the web server.

In short, a server's response time is the time it takes to hear back for a server after a request has been sent. This is also referred as the time to first byte (TTFB).

Time to first byte

Server response time is an important metrics in a website's loading speed because nothing else can actually happen before a website's HTML is received. A website may have been optimized with speed in mind. But no matter how good they are built for speed, if the server where they're hosted is just too slow to respond, the website's page will display slow.

There are many things that can determine your server's response time. They include, and not limited to: web traffic, your website's resource usage, its application logic, routing, frameworks, libraries, resource CPU/memory starvation, your server's software and configuration, your database queries and your web hosting.

And to improve your server's response time, there are basically two ways to do it:

  1. Optimize your website and server more efficiently.
  2. Purchase more powerful server.

The optimum response time for a server is within 200ms of the request being sent. Reducing the time it takes to respond means to take down the number to as closer to 0 as possible. So every milliseconds matter.

Optimizing Your Resources For Better Efficiency

Time to first byte

When your website was still young and having less to no visitors, a cheap hosting plan could be just the thing it needed. But as your website grows older, alongside the marketing, the number of pages and the efforts you made to get more visitors, your website will definitely get a lot more traffic.

As your website needs to respond to more users, it uses a lot more server resources. Your website that was once quick, will become sluggish and slow.

The reason for this is because the more you have visitors, the more pages you need to show. This increases server load. For most websites on the web that use CMS like WordPress, they can be loaded with several CSS stylesheets, many JavaScripts files and other resources. Adding to all those, as well as more customization, images and other media, things can be pretty heavy.

What this means, for each page your website has to show, your server needs to be working several times harder and more frequent than it was previously.

So to improve your server's response time, you need to follow optimization practice. This is to lift some of the loads off your servers by limiting the number of requests and size.

  • Combine external CSS and JavaScript: Many websites that are based with themes tend to have separated CSS and JS files. Plugins or modules, for example, may be bundled with their own stylesheets and scripts. If you can merge those into lesser numbers, you can decrease the number of requests, saving more resources to your server.
  • Minifying resources: After decreasing the number of requests, you can go further by minifying them. What it does is reducing the file size by eliminating human-readable codes, including whitespace and comments. You can also rename their functions and variable names so that they are shorter. After that, you can go even further by compressing those resources at a server level.
  • Lazy loading or defer: This will allow your website's resources to be displayed quickly without having your website to call and downloading all of them at each page load. By implementing lazy loading on images, resources will only be fetched when they're visible on screen. When they're not yet visible, the images won't be called, saving your server some requests. The next thing to check is whether you can delay the parsing of certain CSS and JS by marking them as "deferred" or "asynchronous"?
  • Inline small CSS and Javascript: For small amounts of styling and scripts, you can check whether you can include them straight inside your HTML to eliminate calls to request. This way, your website won't have to connect to your server to have its resources delivered.
  • Keep-alive usage: Make sure you know how your server is using keep-alive as it can affect how your server fulfills requests.
  • Optimize database queries: Do your queries return only want is needed? How many of them are running, and are they optimized for speed? You may see whether your database uses the appropriate indexes. You may also need to change its schema and use external caches.

Following the page speed best practices will increase the amount of traffic your server can serve effectively. Reducing the amount of files and their sizes, your server won't work as hard to deliver your web pages.

Server Optimization And Better Web Hosting

Regardless of the web server you have to serve your web pages, you can improve your its response time by configuring its settings to better suit your needs. For example, Apache is one option used by many servers. While it's not a great performer, it can be tweaked and customized for high performance.

Since web servers are built differently, you should first consult the documentation pages for your particular server configuration to know the recommendations on what you should/could change based on your usage and needs.

Alternatively, you can consider using other or a more powerful web server to host your website, or purchase more powerful hardware.

The first thing to check before doing this is to know whether your web host's server have the sufficient resources for the amount of traffic your website generates. The next thing you should consider is the amount of resources required by users. If your website requires more resources than your web host's server can handle, your website will have to wait longer for your server to respond. This is when your really need an upgrade to your hosting.

Server response time

Conclusion

Website speed is important for many reasons. Here are 4 of them:

  1. A faster website will increase your conversions.
  2. Having the ability to give better experience for customers and visitors, resulting more page views and lower bounces.
  3. Can establish a better brand awareness and competitive ability on the internet.
  4. Search engines bots won't have delay and difficulties, making them love your website even more.

While your server response times account for only 10 percent of the total delay time in delivering your whole site to your users, there are certainly ways for you to maximize your server's performance and reduce any lags.

Since nothing can actually happen before your website's HTML is received, you should considering an optimization to how your website needs resources and how your server respond to requests. Especially when you see that its performance is deteriorating.