/ HTTP Status Codes

203 Non-Authoritative Information

The 203 Non-Authoritative Information HTTP status code is part of the Hypertext Transfer Protocol (HTTP) response status codes. This status code indicates that the returned information in the response message is not directly from the origin server but from an intermediary. It is important to understand the meaning, use cases, and implications of this status code to properly handle it in your applications.

Understanding the 203 Status Code

When a client makes an HTTP request, it expects to receive the requested information from the origin server. However, sometimes the response may be generated by an intermediary, such as a proxy or cache server, rather than the origin server itself. In such cases, the 203 Non-Authoritative Information status code is used to inform the client that the response data might not be the most up-to-date or accurate information available.

This status code is part of the HTTP/1.1 specification (RFC 2616) and is categorized under the informational class of status codes (2xx). It should be noted that the 203 Non-Authoritative Information status code is not widely used and is considered optional by the HTTP/1.1 specification.

Example Scenario

To better understand the 203 Non-Authoritative Information status code, let’s look at a practical example.

Request

Suppose a client sends an HTTP GET request to fetch a resource from the origin server:

GET /resource HTTP/1.1
Host: example.com

Response

However, due to some network configuration, the request is being served by a caching proxy server. The proxy server has a cached version of the requested resource, but it is not sure if the cached version is the most up-to-date. In this case, the proxy server should return a 203 Non-Authoritative Information status code along with the cached resource in the response:

HTTP/1.1 203 Non-Authoritative Information
Content-Type: application/json
Date: Mon, 01 Jan 2021 12:00:00 GMT

{
  "data": "Cached resource data"
}

This informs the client that the returned data is from an intermediary and not directly from the origin server.

Handling 203 Non-Authoritative Information

When a client receives a 203 Non-Authoritative Information status code, it should treat the response as potentially outdated or inaccurate. Depending on the specific use case and the criticality of the information, the client may choose to:

  1. Accept the non-authoritative information and proceed with processing the response.
  2. Send a new request with cache-control directives to bypass the intermediary and fetch the most up-to-date information from the origin server.
  3. Notify the user or system administrator about the non-authoritative information and let them decide how to proceed.

It is essential to handle the 203 Non-Authoritative Information status code correctly to ensure that the client application behaves as expected when dealing with potentially outdated or inaccurate information.

Summary

The 203 Non-Authoritative Information HTTP status code is an informational status code used to indicate that the response data is not directly from the origin server but from an intermediary. While not widely used, it is essential to understand and handle this status code correctly in your applications to ensure proper behavior when dealing with non-authoritative information. By following the guidelines and examples provided in this article, you will be better equipped to handle the 203 Non-Authoritative Information status code in your applications.

Was this helpful?

Thanks for your feedback!