When it comes to website performance, milliseconds matter. A lot of research shows that small changes in website performance impact key business metrics, such as conversion rates and revenue. One of these factors is server response time. Here’s how you can improve server response time for your website.
Server response time is the amount of time it takes for a web server to respond to browser requests. The smaller the response time in milliseconds, the better. Even if your website is really well optimised, it will still be slow to end users if your server is slow, particularly when under load! This is why it’s so important.
Here’s are some factors that impact server response time, and suggestions for how to improve it.
1. Poorly written web applications and plugins
Inefficient code executes slowly, which means the server has to spend a long time doing things before it can respond to your request. The more time the web application spends interpreting code, the slower the response time.
To minimise that chance that your website is using poorly written slow code you should:
- Regularly upgrade your Content Manage System and plugins to the latest versions
- Only use well respected plugins that have good reviews
- Be judicious in selecting plugins and use as few as possible. If something can be done simply without a complicated plugin, it’s typically going to be faster.
2. Out of date programming language versions
Programming languages can have a huge impact on server response times, with statically typed, compiled languages (e.g. C#, Java) being much faster than interpreted languages like PHP, Ruby and Python.
As most brochure websites and blogs use Content Management Systems (CMS), changing languages isn’t a viable or cost effective solution. Thankfully, you can often see large improvements in server response time simply by updating to the latest version of the programming language your CMS uses. This is especially the case for PHP, which powers most websites around the world (e.g. WordPress, Joomla and Magento), with PHP7 giving massive performance improvements.
Migrating your site to PHP 7.0, or ever better 7.1 or 7.2, is an easy way to improve your website’s server response time. If your web host doesn’t make the latest version of PHP available soon after it is released, assume they probably aren’t all that interested in your site performance.
3. Crowded shared-hosting environments
Servers only have finite resources, in particular CPUs (i.e. the brains) and RAM (i.e the memory). These resources limit the total number of requests that a server can respond to at any given moment.
The more CPUs and more RAM in a server, the more requests it can respond to quickly at the same time. When they are maxed out the server simply cannot respond to any more requests, so subsequent responses go into a queue and slow down your site.
Generic web hosts often lump many sites together on a single server, without allocating dedicated resources to each site, because it’s easier and more profitable… for them… but not for you.
If you notice your website is intermittently fast and then slow, even when traffic remains the same, it may be that your site is hosted on a server with many other sites monopolising its resources.
If you suspect this, ask your web host if they are using software like CloudLinuxOS to ensure your web site has dedicated resources available.
4. Minimise the number of requests to your server
Each time your website requests something from your server, it uses resources. As these resources are finite, they limit the amount of traffic your server is able to respond to.
Requesting your home page in a browser may seem like one request, but what happens under the hood is another story. Typically, your browser also makes separate requests for other files (e.g. CSS, javascript, images) from your server, just to display a single page! Each of these calls uses up some of the server’s responses! By reducing the number of calls required to display a single page, you can increase the amount of traffic that your site can handle, and stop it from slowing down, especially in peak times.
There are many ways to reduce the number of requests to your server, such as:
- Combine and minify all of your javascript and CSS files
- Use a Content Delivery Network (CDN), such as Cloudfront, to store your files externally so browsers don’t need to request them from your site
- Use a reverse proxy like NGINX or a cache and pass requests directly to static files
These are just some examples of how we help improve server response time for our Australian website hosting clients. If you are interested in making websites fast, check out our article on 10 Website Speed Metric You Should Know.