Category Archives: Google http (server) response headers testing

Here we test how Google treats different server response codes.

283 – Non existing, nonsensical 2xx response code and Google Bot

Let’s test how Google (and Chrome) would react if we have a nonsensical response code like 283.

I think G and Chrome will treat it just as if it was a normal 200. Because it starts from 2, which implies the request was processed with no errors and here’s the legit response.

I even have a custom description for this code. Here how this page looks currently:

283 response code

283 response code

Here’s how Google sees the page in GSC’s fetch:

GSC Fetch of code 283

GSC Fetch of code 283

See how it says internal server error instead of what I set? Google doesn’t like custom http status descriptions. GSC treats it as 5xx, which are the server errors.

Anyhow, we’ll see how Google consumes this page. I suspect Google Bot won’t think it’s an error page and would index and rank it.

Funny enough, the page got indexed and ranked despite the code. What if the code would be legitimately 500, but a page would serve content in a body?

Shouldn’t forget to test it…

202: Accepted and Google Bot

202: Accepted generally means that the processing of the request started. And there will be no further updates in this session. From Google’s perspective this would mean that Google just has triggered some heavy process with unknown consequences. In our case, of coarse, there is no such process, but it’s interesting how Google would treat the request.

This page returns the 202, here’s the screenshot:

202 accepted network screenshot

And here’s a nice description of the 202:

The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

There is no facility in HTTP for re-sending a status code from an asynchronous operation.

The 202 response is intentionally noncommittal. Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent’s connection to the server persist until the process is completed. The representation sent with this response ought to describe the request’s current status and point to (or embed) a status monitor that can provide the user with an estimate of when the request will be fulfilled.

(c) https://httpstatuses.com/202

201: Created and Google Bot

How would Google react if a page has just been created as a result of Google’s request?

This page returns a 201: Created. Here’s a screenshot of how it looks:

201: created network screenshot

Here’s a little info on what a 201 is.

According to Wikipedia, it means that the request has been fulfilled, resulting in the creation of a new resource.

However, it’s better to know more.

The primary resource created by the request is identified by either a Location header field in the response or, if no Location field is received, by the effective request URI.

The 201 response payload typically describes and links to the resource(s) created. See Section 7.2 of RFC7231 for a discussion of the meaning and purpose of validator header fields, such as ETag and Last-Modified, in a 201 response.

(c)  https://httpstatuses.com/201

204: No content and Google Bot

What if this page returned 204: No content, but still would have content in the http body? Not just content, but meaningful, worthy of indexing content just like these wonderful words?

Unfortunately, modern browsers don’t open the 204s. Therefore. if I set the 204 for this page, you wouldn’t be able to read this text, so the actual 204 would be here.

Feel free to try and open/inspect it if you like. It would seem like a completely empty page. You can add ?1=200 to the end of the url to see the content of the page with the 200 code. That’s how my script works there – it takes three last characters of the url and if they are numeric, uses them in the http header.

Would Google ignore the facts and stop parsing after recognizing the 204? Or would it ignore the response code and index/rank this page as if it was a 200-page? Let’s see.

Probably Google will ignore the page since no browser is able to open it 🙂

What is a 204

I just have to write something more to make sure G doesn’t treat this page as empty, so let’s take a look at what 204 is and what kinds of additional fields it supports.

Wikipedia claims that 204 means “The server successfully processed the request and is not returning any content“.

I, however, prefer this amazing description here:

Metadata in the response header fields refer to the target resource and its selected representation after the requested action was applied.

For example, if a 204 status code is received in response to a PUT request and the response contains an ETag header field, then the PUT was successful and the ETag field-value contains the entity-tag for the new representation of that target resource.

The 204 response allows a server to indicate that the action has been successfully applied to the target resource, while implying that the user agent does not need to traverse away from its current “document view” (if any). The server assumes that the user agent will provide some indication of the success to its user, in accord with its own interface, and apply any new or updated metadata in the response to its active representation.

For example, a 204 status code is commonly used with document editing interfaces corresponding to a “save” action, such that the document being saved remains available to the user for editing. It is also frequently used with interfaces that expect automated data transfers to be prevalent, such as within distributed version control systems.

A 204 response is terminated by the first empty line after the header fields because it cannot contain a message body.

A 204 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls1.

I found it on https://httpstatuses.com/204 Great stuff.