On Sat, Jul 18, 2020 at 5:09 PM <colecmac at protonmail.com> wrote:
>
> Hello all,
>
> A stream status code has been mentioned on this list before, and I'd like to
> bring it up again. Streams have begun appearing on Gemini, notably on
> gemini://chat.mozz.us. But at the same time, responsible clients have been
> adding timeouts for server responses. It is even part of the Egsam test, under
> section 1.1: gemini://egsam.pitr.ca/1.1.gmi.
>
> The best solution that I see, as I believe that streams can be very useful and
> interesting, is to add a SUCCESS AS STREAM status code. I propose status code 21.
>
> Thoughts? I know Solderpunk has said that there won't be non-trivial changes to
> spec from now on, but I hope he will see this as an important exception.
>
> Thank you,
> makeworld
>
Hi!
I really like the idea of streaming in gemini! I don't know if it will ever see
widespread adoption outside of a few tech demos, but it's fun to play around
with nonetheless. Here are some of my thoughts on adding a separate status
code.
First, I haven't yet heard a justification for why a client should ever force
the connection to timeout. Adding a short timeout on resolving the host and
establishing the connection, sure that makes sense to me. But why force close
the connection once it has already been established? With gemini's single
request/response model, there should be a person sitting in front of the
keyboard waiting for the page to load. Show them the transfer rate in
bytes/second and let *them* make an informed decision of when to give up based
on their own context. Doing anything else is taking away agency from the user,
and for what gain? If I want to sit in front of a loading screen for an hour
(and keepalive packets are still being sent) I should be allowed to.
The above paragraph doesn't apply to automated requests coming from tools like
gemini scrapers. Those will obviously still need some sort of global timeout on
all connections, regardless of whether they are marked as streaming or not. But
I would argue that that problem is better solved with something like robots.txt.
Second, I haven't yet heard a justification for why clients should be forbidden
from handling responses before they have finished downloading. This is more
fundamental than streaming as it is being discussed in this thread. If I
download a 300 MB mp3 file from your gemini capsule, I should be able to
start playing the audio before the whole thing has finished downloading.
Likewise for rendering images or large text files.
I would argue that "handling" a response also includes saving it to the
filesystem, so any gemini client that can stream a large response to a file
instead of holding the whole thing in memory is already doing this.
Third, I will suggest that the distinction between "streaming" and "non-
streaming" is totally meaningless. Hannu recently stood up an ansi art
mirror [0] which hosts small text files and puts a short time delay between
characters to emulate old modems. Is this streaming? The files have a finite
size and download fairly quickly. Even a naive gemini client could download
them, although it might appear slow. If there was no artificial delay, it
certainly wouldn't be considered streaming. But what if the delay was bumped up
to 30 seconds between characters? What if the delay was not deliberate, but
caused by a slow filesystem on the server? Going in the other direction, if my
server hosts a 1 TB image file it might as well be considered an infinite
stream for all practical purposes.
In summary, my feeling is that most of the features that we associate with
streaming are also relevant to all other gemini requests. If a client wants to
support streaming pages like
gemini://chat.mozz.us, then they don't need a
status code to make that distinction. There might be some value in a separate
status code to inform dumb clients that they should not even attempt to load
the page. But there's no clear line to draw in the sand between what is
streaming and what isn't. I think this kind of context information is better off
in human-readable descriptions next to links.
- mozz
[0]
https://portal.mozz.us/gemini/ansi.hrtk.in/