Skip to content

Proposal for new success Status Code

This is the proposal for a new status code in Gemini. In accordance with Gemini conventions a new success response would be in the range of 21 to 29 (because 20 is already taken).

The success response in question would be a similar to a 304 Not Modified (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304). For the rest of this issue I will call this status the 21 (Not Modified) status.

Example

Client: gemini://example.com/resource
Server: 20 gemini/text ...
* The gemini text would include a link "=> /resource?12345 Reload if new version is available" the query would include a version id for said resource.
* Eventually the client clicks the link
Client gemini://example.com/resource?12345
* Here two things can happen. 
A) the version id of the resource has changed, respond normally with data and status 20. or
B) the version id of the resource is the same, respond with a new success status code (say 21) and no meta and no binary content.
* Let's take path B)
Server: 21
Client: Upon receiving 21 client expects no meta and no content and no update is issued on the already rendered content.

Why is this a proposal for a new success code and not a new redirection code?

The HTTP status for 304 redirects client so they can check their cache instead. However, caches not being required for gemini clients this is more akin to an error message, but with a success semantic. No binary is sent, no need to update the content you already are displaying.

What are we missing

Whenever this mechanism could be used and it isn't, data and energy would be wasted on redownloading something known to not have changed (in case of a 20 response or a redirect to a success, which is the most natural thing to do).

Alternatively, error status codes could be used, with messages that explain this is not an error but could also be misinterpreted

Observations/Issues

One observation is that links that may or may not result in a 21 (No Content) are primarily .intended to be displayed on pages that have the same path (if perhaps with a different version) than the path in the link in question. A 21 response would update the current url without changing the contents of the page.

What happens if the url returning 21 is in a different path or comes from bookmarks? My recommendation would be to reissue the request without query params.

Edited by corlaez