Illusory latency due to trailing slash redirects
Paper
paper at tilde.institute
Sat Jun 27 20:37:46 BST 2020
On Sat, Jun 27, 2020 at 08:57:14AM +0000, solderpunk wrote:
> Gemini servers (and servers for any other protocol supporting relative
> URLs, including HTTP) will use redirects to get clients to add a
> trailing slash to a URL which maps to a directory on the server's
> filesystem. Handling this redirect is often invisible to the client
> user, with the result that what "looks and feels" like a single request
> is actually two immediately consecutive requests. This makes latency
> appear to be much worse than it actually is. Perhaps this underlies
> some people's perceptions that Gemini has unacceptable latency.
>
> This basic problem is unavoidable, but there are many small things
> client and server authors can do to minimise how often it happens:
>
> In general, the client can't add a missing trailing slash itself because
> it never knows if a given URL maps to something file-like or something
> directory-like. An interesting exception is the root of the server.
> Molly Brown and Jetforce (but not GLV-1.12556) both seem to redirect
> gemini.example.com to gemini.example.com/, making the loading of
> "homepages" feel slower than it needs to. I'm pretty sure it should be
> safe for clients to automatically append trailing slashes to URLs
> without paths.
I have a script which checks for redirects on websites and reports
status codes. On web it is much smaller problem - the saved latency is
much less. This way I can see dead links and links which could cause
problems - http redirects instead of https or normal redirects which can be
optimised. Maybe something similar could be done for gemini, so that content
authors could check if their links are ok.
I don't like this idea, because content authors should focus on writing
content, not on how the content looks or if they are writing it the
"correct way". Linters for gemini code sound like a bad idea and a sign
that something is wrong.
> On the server side, server authors should take care when doing things
> like automatically generating directory listings to put trailing slashes
> in links to directories so that the redirect is not necessary.
That's the best solution I think.
Paper
More information about the Gemini
mailing list