Skip to content

Cache contributions for faster responses on repeated requests #60

@GuusLieben

Description

@GuusLieben

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions