Cache settings #480

Open
opened 2023-08-28 04:35:46 +12:00 by nbenaglia · 3 comments
nbenaglia commented 2023-08-28 04:35:46 +12:00 (Migrated from github.com)

As user I'd like to decide when cache files in ~/.local/share/gossip/cache/ should be cleaned:

  • when gossip is shut down
  • when cache files are older than N days

In settings the "Database" tab should be renamed in "Storage" (more generic) and the above new cache options may stay together with the current database tab content .

As user I'd like to decide when cache files in `~/.local/share/gossip/cache/` should be cleaned: - when gossip is shut down - when cache files are older than N days In settings the "Database" tab should be renamed in "Storage" (more generic) and the above new cache options may stay together with the current database tab content .
mikedilger commented 2023-08-28 07:55:41 +12:00 (Migrated from github.com)

Some cached files are heavily used (your own avatar) and others haven't been used in a long time. But we have no reliable way to distinguish between these cases.

Many people's filesystems don't maintain or support last-accessed times because every read then requires a write. So we cannot reliably ask "only delete files that haven't been accessed recently."

If we delete cached files when they get old, then people will be almost immediately re-download some of those.

Options:

  1. Try using the file system access time anyways, fall back to modification time. Redownloads will happen.
  2. Maintain access times in LMDB somewhere. If doing this, we should save the etags there too.
  3. Separate avatars and banners from other content, and only prune the other content.
Some cached files are heavily used (your own avatar) and others haven't been used in a long time. But we have no reliable way to distinguish between these cases. Many people's filesystems don't maintain or support last-accessed times because every read then requires a write. So we cannot reliably ask "only delete files that haven't been accessed recently." If we delete cached files when they get old, then people will be almost immediately re-download some of those. Options: 1. Try using the file system access time anyways, fall back to modification time. Redownloads will happen. 2. Maintain access times in LMDB somewhere. If doing this, we should save the etags there too. 3. Separate avatars and banners from other content, and only prune the other content.
mikedilger commented 2023-08-28 09:27:58 +12:00 (Migrated from github.com)

Ok I did option 1 for now. I think option 3 is best, but I'll do it later.

Ok I did option 1 for now. I think option 3 is best, but I'll do it later.
nbenaglia commented 2023-08-28 18:38:06 +12:00 (Migrated from github.com)

I update to track the changes.

Option 1 done with commit 6451709

I update to track the changes. Option 1 done with commit [6451709](https://github.com/mikedilger/gossip/commit/64517090257261b3d788bd468024079a3f698cf2)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nostr/gossip#480
No description provided.