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

Tweak the caching layer #70

Open
ralphtheninja opened this issue Jul 31, 2022 · 1 comment
Open

Tweak the caching layer #70

ralphtheninja opened this issue Jul 31, 2022 · 1 comment

Comments

@ralphtheninja
Copy link
Member

ralphtheninja commented Jul 31, 2022

Currently we have several caches spread out on all the backends, e.g. http and hyper. This code should be moved up one layer, into storage/index.js. This would:

  • remove redundant code
  • have one point where the caches reside for easier maintenance when clearing cache etc
  • enable/disable caching, some endpoints on some platforms might not need any caching, since they are already cached themselves or the indexdb caching is just slower than not using it (I'm looking at you electron + hyperdrive!)
  • indexdb is slow and we might need to tweak or replace it and we don't want to do that in several places, also we might use something else entirely in electron (maybe level for node is just fine)
@ralphtheninja
Copy link
Member Author

It would also be easier to add an additional hot cache, where we store frequently requested tree files in memory as well. And once a tree file becomes "old", we clear it from the in memory cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant