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 contributions for faster responses on repeated requests #60

Open
GuusLieben opened this issue Dec 25, 2023 · 0 comments
Open

Cache contributions for faster responses on repeated requests #60

GuusLieben opened this issue Dec 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@GuusLieben
Copy link

Related Problem

When using a longer timeframe for the graph (e.g. 365 days), the request to generate the graph can take a bit longer. This is fine on the initial request, but it would be preferable if consecutive requests are faster.

Requested Feature

Implement caching to ensure consecutive requests are faster. This could clear the oldest entries according to two strategies:

  1. After X amount of time
  2. After N amount of entries are present

You could opt for either, or both of these strategies.

Something to keep in mind is the timeframe parameter. It makes sense to re-use values from e.g. 365 days when requesting just 50 days. The other way around (50 days cached, 365 days requested) would be up for debate. You could use one of the following strategies:

  • Request data without the past 50 days, so you only have 315 new entries, but would require merging.
  • Request the full data set and overwrite the existing entry

Personally I'd go for option 2, as it has less overhead, but both have their benefits. Especially if you decide to support larger timeframes (e.g. 5 years) option 1 could be interesting

@GuusLieben GuusLieben added the enhancement New feature or request label Dec 25, 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
Projects
None yet
Development

No branches or pull requests

1 participant