Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache settings #480

Open
nbenaglia opened this issue Aug 27, 2023 · 3 comments
Open

Cache settings #480

nbenaglia opened this issue Aug 27, 2023 · 3 comments
Labels
Enhancement New feature or request In progress The development is started

Comments

@nbenaglia
Copy link
Contributor

nbenaglia commented Aug 27, 2023

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
Copy link
Owner

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
Copy link
Owner

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

@nbenaglia
Copy link
Contributor Author

I update to track the changes.

Option 1 done with commit 6451709

@nbenaglia nbenaglia reopened this Sep 20, 2023
@dtonon dtonon added Enhancement New feature or request In progress The development is started labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request In progress The development is started
Projects
None yet
Development

No branches or pull requests

3 participants