~lioploum/offpunk#3: 
Error pages are stored in the cache

Calling offpunk fakedomain.foo creates a cache entry at ~/.cache/offpunk/gemini/fakedomain.foo/index.gmi with the following contents:

2022-11-24 16:44:31.224119
ERROR while caching gemini://fakedomain.foo/

*****

<class 'socket.gaierror'> = [Errno -2] Name or service not known
*****

If you believe this error was temporary, type reload.
The ressource will be tentatively fetched during next sync.

As a user experience it's probably better to not store anything if visiting a URL failed.

Status
REPORTED
Submitter
~sotirisp
Assigned to
No-one
Submitted
2 years ago
Updated
1 year, 6 months ago
Labels
No labels applied.

~lioploum 2 years ago

Why do you consider it as a bug?

I agree that it is not perfect and I’ve considered having a .cache/offpunk/error folder which would be a mirror of the other cache but for error only.

I plan to do a major rewrite of offpunk to completely separate the network/caching from everything else and I may change the behaviour at that point. I don’t consider it an urgent problem as "it works for me" (feel free to convince me of the opposite)

~sotirisp 2 years ago

Oh I definitely don't consider it an urgent issue. Just posted it as something to consider in the future. Having a separate error cache sounds like a good idea.

~lioploum 1 year, 6 months ago

Wondering if any effort should be made to put this into offpunk 2.0.

Current code separation may make it quite easier as it implies modifying only netcache to do the following:

  1. Function set_error should write in its own folder, not in the cache anymore
  2. cache_last_modified() should return the most recent modification time from either the real cache or error cache

But I realize writing this that there’s a catch. What happens if there’s an error and no cached version ?

If we consider this as a valid cache, offpunk will try to retrieve it through get_cache_path and there’s nothing there! If we consider it as an invalid cache, offpunk will try again and again to redownload it.

Also, what if we have an older, valid cache but an error to refresh? How do we display that?

~lioploum referenced this from #30 1 year, 3 months ago

Register here or Log in to comment, or comment via email.