Your server-side/back-end performance plays a crucial role in your page performance. Here are some possible reasons as to why it may be slow.
Overview
Your page’s performance is made up of both front-end and server-side components. GTmetrix assesses the front-end structure of your page to ensure that it is delivered as optimally as possible to your visitors, but an optimized server-side is also an important part of the equation in offering a fast and seamless site experience.
Test your site now!
With the Performance and Structure scores, it’s easy to put too much emphasis on the front-end and forget about the server-side. It’s important to remember that even though you may have good Performance and Structure scores, you could make your page even faster by optimizing your server-side.
What Makes up my Page Load Time?
When a request for a page is made, the front-end and server-side components both take a certain amount of time to complete their operations. Since their operations are essentially sequential, their cumulative time can be considered the Total Page Load Time.
Even after you’ve optimized your front-end, speed gains can still be achieved by optimizing the server-side. This means optimizing the way the page is generated by your server.
A good indicator of your server-side performance is the time it takes to generate the HTML page (Page Generation Time). This is labeled as “Waiting” time on the first element in the waterfall graph (also known as the “Time-to-First-Byte”). Generally, this time should be kept under 600 milliseconds (or as low as possible).
How Can I Make the server-side Faster?
There are many causes to a slow server-side, but they can essentially be grouped into two categories:
- Inefficient code or SQL
- Bottlenecks/Slow Server
Since each site has a unique platform and setup, the solution to these issues is dependent on each site. One site might need to have their server-side code optimized, but another might just need a more powerful server. Budget constraints may also come into play, as optimizing server-side code for minor speed gains might be more affordable than upgrading servers for massive speed gains.
It’s best to truly understand your requirements before pursuing a server-side option path.
Solutions
The following optimizations are commonly used to improve server-side speed:
Code Optimization
Programming languages like PHP, Perl, Python, or ASP are usually teamed up with databases like MySQL, PostgreSQL, or Microsoft SQL Server to create software such as WordPress, Drupal, Magento and all sorts of custom platforms.
This software is usually fairly optimized out of the box, but there are often many customizations to the code or plugins that cause slow performance as a result of inefficient code or un-optimized database queries.
Code optimization involves analyzing the code and database queries and finding the spots where the code is inefficient and where database queries are slow. After finding these “hotspots,” it’s the job of a developer to fix those problems. For code, this often involves finding a better algorithm or modifying the code to work around a bottleneck (ie. hard disk space or I/O, bandwidth, etc). For databases, this may involve adding indexes to speed up the query, rewriting the query, or modifying the structure of the database.
Page Caching
Most websites today are dynamic, meaning that they pull from a database of information, insert the pulled data into templates, and then serve them to you. This happens every time somebody requests a page from the server, and the time it takes to perform this process is dependent on the efficiency of the code and the power of said servers.
Without Page Caching
Since the server is handling thousands of requests for the same page, and is essentially “building” the same page every time, why not build the page once, and send that “pre-built” version to anybody that requests it? This is referred to as page caching.