Let’s say you want to buy a pair of sneakers to use while strolling around the mall. Instead of visiting a physical store, you decided to buy the shoe from the brand’s site, for example. All you need to do is type the brand name into the search bar and click the enter button. Congratulations, thousands of shoes are waiting for you to buy! Do you know what’s happening in the background while you effortlessly surf the internet? Each time you visit a website, you actually create a communication between the browser you use and a web server. The browser sends a request to the webserver to display what you expect. And in return, the server responds to it. At this point, the server sends a message to the client with a series of response codes to indicate the request’s status. So what is this response code?
In today’s comprehensive guide, we’ll first answer the question, “What are status codes in the HTTP world?”. Then, we’ll dive into the codes and examine them in 5 distinct categories. In the end, we’ll share six perfect tricks that can improve the speed at which the server responds, leading to a better experience for your website visitors. Are you ready? Let’s dive in!
What Are HTTP Status Codes?
HTTP status codes are the server’s reply to a request made by a browser (also known as ‘the client’). When you access a website, your browser sends a request to the server, and the server provides a three-digit code. This is what HTTP status codes are. Each code consists of 3 numerical digits and is primarily in use to signal the success or failure of a request sent by the client.
HTTP status codes are in five separate groups based on the first digit of the code.
- 1xx – Informational Response Status Codes: This code signifies that the server has received the request and is currently undergoing processing.
- 2xx – Succesful Status Codes: This code represents a successful receipt, acceptance, and comprehension of the request.
- 3xx – Redirection Status Codes: This code means additional steps are necessary to complete the request successfully.
- 4xx – Client Error Status Codes: This code indicates a problem with the request, resulting in it not being fulfilled.
- 5xx – Server Error Status Codes: This code shows that the server was unable to fulfill the request due to a server-side issue.
Each class contains a variety of server codes that may be returning from the server, ranging from 00 to 99. These codes have specific and distinct meanings. So, let’s start introducing you to the most received status code!
Learn more with the HTTP request guide!
100 Status Codes
HTTP status codes starting with 1xx indicate that the client’s request is still in process. A 100-level status code provides additional information to inform you of the current situation of the request.
- 100 – Continue: Signifies that the server has received the first part of the request and has not yet rejected it.
- 101 – Switching Protocols: This signifies that the request has an Upgrade header. This indicates that the server is in the process of switching to a different protocol.
- 102 – Processing: This signifies that the server has gathered the entire request from the client and has not yet completed it.
200 Status Codes
The optimal outcome is receiving an HTTP status code within the 200 range. This indicates that all functions are operating correctly. In this group, 200 and 201 codes are the most common status codes.
- 200 – Ok: Signifies that the request sent by the server was successful.
- 201 – Created: Signifies that the server has finished handling the request and has created one or more new resources.
- 202 – Accepted: Signifies that the request has been accepted for processing but has not been completed yet.
- 203 – Non-Authoritative Information: This signifies that the HTTP request was successful, but a change has been made by using a proxy.
- 204 – No content: This signifies that the server has successfully completed the request, and there is no further information to be included in the response.
- 205 – Reset Content: This signifies that the server has satisfied the request and instructs the browser to reset the document.
300 Status Codes
Getting a status code starting with 3 is a method to notify that a resource has been relocated to a new resource URL or location. The response code received by the client could be moved to a temporal or permanent location.
- 301 – Moved Permanently: This signifies that the requested resource has permanently moved to a new URL.
- 302 – Found: This signifies that the resource request has been moved temporarily to a new URL.
- 303 – See Other: Instructs the client (browser) to request a different URL as indicated in the Location header of the response.
- 304 – Not Modified: This signifies that the website/web page being requested has not been updated since the last time it was accessed.
- 305 – Use Proxy: This signifies that the requested resource can only be accessed using a proxy.
- 307 – Temporary Redirect: Specifies that the target resource temporarily moves to a different URL.
- 308 – Permanent Redirect: This specifies that the target resource has been given a permanent new URL.
400 Status Codes
400-level status codes indicate an issue with the request and/or the browser. Not that when a client tries to access a resource that doesn’t exist, it results in the well-known 404 error response code.
- 400 – Bad Request: This signifies that the server is unable to handle the request due to an error made by the client.
- 401 – Unauthorized: This signifies that the request has been denied due to the client providing invalid authentication credentials for the requested resource.
- 402 – Payment Required: This signifies that payment must be made before accessing the requested resource.
- 403 – Forbidden: This signifies that the client lacks the necessary permission to access the content.
- 404 – Not Found: This signifies that the server cannot find a matching resource for the request pointing to a URL.
- 405 – Method Not Allowed: This signifies that the request method utilized is not permitted on the target resource. For example, if the client issues a PUT request on a resource that enables only a GET request, a 405 status code will be received.
- 406 – Not Acceptable: This specifies that the requested resource is unable to generate content that meets the criteria set by the request’s content negotiation headers.
- 407 – Proxy Authentication Required: This specifies that Authentication is necessary to use a proxy.
- 408 – Request Timeouts: This specifies that the server timed out while waiting for the client to send a complete request message.
- 409 – Conflict: This specifies that the request could not be fulfilled because of the conflict with the current state of the target resource.
- 410 – Gone: This specifies that the origin server can no longer provide access to the requested resource, which is expected to remain permanent.
500 Status Codes
The status codes starting with 5 also indicate a problem. However, the source of the problem lies on the server side, making it harder to fix compared to client-side errors.
- 500 – Internal Server Error: This signifies that the server has encountered an unexpected issue that prevents it from fulfilling the request.
- 501 – Not Implemented: This signifies that the required functionality needed to complete the request is not supported and cannot be handled by the server.
- 503 – Service Unavailable: This signifies that the server is unavailable or unable to respond to requests; This could be temporary or permanent. Learn how to fix HTTP 503 error here.
- 504 – Gateway Timeout: This signifies that the gateway or the proxy server failed to receive a timely response from the upstream server required to fulfill the request.
- 505 – HTTP Version Not Supported: This signifies that the server doesn’t support the version of HTTP used by the client to make the request.
How to Improve Server Response Time
Improving server response time should be your top priority as a website owner. You may be wondering why. It is true that if the website takes too long to load, it causes visitors to leave the web page immediately. It means that your potential visitors never come back to you and navigate away to your strong competitors’ websites. So, it’s clear that response time significantly affects your user experience (UX) and search engine optimization (SEO) strategies. Learn more about HTTP and SEO.
If you're not into web design, you may have never heard of CLS or Cumulative Layout Shift in its full name. This issue, which you can encounter while ...
- One in 4 visitors leaves a website that takes more than 4 seconds to load.
- A 1-second delay reduces visitor satisfaction by 16% and a conversion rate by 4,45%.
- Pages loaded in 2 seconds have a one-page visit rate of 9%, while these loaded in 5 seconds have a one-page visit rate of 38%.
Once you’ve understood the importance of a fast server response time, it’s time to look at ways to reduce it quickly!
- Select a Powerful And High-Performance Server: First things first. Having consistent and quick server response times can be possible by investing in a powerful, reliable, high-performance web server.
- Optimize Your Database: In the early days of a website launch, the database can respond quickly to queries. However, as more data accumulates over time, the database becomes cluttered with information. Therefore, you should optimize your queries to return only the necessary information. So, implement relevant and suitable indexes, and organize your database schema.
- Optimize Your Website Files: If your website contains unoptimized codes, the web pages will take longer to load and process HTTP requests. Optimizing the file size will quicken the web page’s loading time.
- Set up Caching: Without caching, a browser sends requests to the server whenever a page is in load instead of retrieving them from a local or temporary cache. So, configuring caching allows you to speed up the response time of web pages for visitors.
- Use a CDN: Content Delivery Network, or CDN for short, refers to a network of servers spread worldwide with local copies of data stored to facilitate faster content downloads. Once a CDN is in use, multiple proxy servers will maintain copies of your web content. If the primary server is distant from an international user, the cached data will allow them to access your site fastly. This improves the content delivery speed.
- Detect 404 Errors and Eliminate The Errors: Web visitors receive 404 errors when they request a no longer available page. This situation creates a negative experience. Moreover, these requests still consume your web server’s space and resources, causing the server to be overwhelmed.
Requests and responses are at the heart of the HTTP world. A browser, or a client, sends a request to a web server, and the server immediately receives it to process. After this process, the server sends an appropriate response. At this point, one or more status codes may be sent to the client. This is precisely what a response code is, which indicates what is going on during the process. By looking at the response code, it is possible to understand whether or not the request is currently working. If you receive the codes starting with 4 or 5, try to fix it without a moment to spare!