[tech] Client history behavior with redirects

Oliver Simmons oliversimmo at gmail.com
Thu May 20 17:16:39 BST 2021
On Mon, 17 May 2021 at 17:50, Michael Lazar <lazar.michael22@gmail.com> wrote:
>
> Hi all,
>
> I have a question on a common design pattern in gemini. Say we have
> a guestbook, message board, etc. that accepts user comments via an
> input query. A normal session with a client might look like this:
>
> ```
> C: /
> S: 20 text/gemini (display the home page)
>
> C: /guestbook
> S: 20 text/gemini (display the guestbook page)
>
> C: /guestbook/input
> S: 10 enter your message
>
> C: /guestbook/input?hello%20world
> S: 30 /guestbook (submit the user's message and redirect)
>
> C: /guestbook
> S: 20 text/gemini (display the guestbook page)
> ```
>
> Now, what should happen at this point when the user clicks the
> "back" button in their client?
>
> ⚞snip⚟

The way I would like it is:
```
C: /
S: 20 text/gemini (display the home page)
Stored in history

C: /guestbook
S: 20 text/gemini (display the guestbook page)
Stored in history

C: /guestbook/input
S: 10 enter your message
Not stored due to it being an input (resp. code 1x)

C: /guestbook/input?hello%20world
S: 30 /guestbook (submit the user's message and redirect)
Redirect not stored, the page redirected to should be stored (resp. code 3x)

C: /guestbook
S: 20 text/gemini (display the guestbook page)
Stored in history. It's a duplicate of the previous page in history
though, so it should probably be removed.
```

That is, response codes 1x and 3x aren't stored in history, and
duplicates of the same URI (including query!) in history are merged
into one.
It's not the query that makes it not store, it'd be the response code.
So if /guestbook/input?hello%20world gave a 20 response code instead
it would be stored, as that's likely a unique page e.g. search results
or generated content.

This shouldn't be required behaviour, it'd be a "best practice"
recommendation instead.
Different browsers have different preferences and in an ideal world
this would be configurable by settings.

-Oliver Simmons


Archive home | About this archive