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

Query Caching #991

Open
ErikBjare opened this issue Nov 15, 2023 · 1 comment
Open

Query Caching #991

ErikBjare opened this issue Nov 15, 2023 · 1 comment

Comments

@ErikBjare
Copy link
Member

ErikBjare commented Nov 15, 2023

I've thought about adding proper caching of queries to make browsing historical data much snappier, after the first open.

The goal is to:

  • make the day/week/month selector (simple barchart at top) load faster
  • make the "Timeline (Barchart)" load faster

As a first step, I've considered adding query caching to aw-client-js such that queries are:

  • cached by timespan
  • if timespan spans the future, don't cache
  • only cached if the query returned data for the timespan

Should be a simple improvement, that could massively improve responsiveness and thus general UX of web UI, especially when browsing historical data.

I'm not sure what kind of cache expiry to add, but I might figure that out as I get going.

PRs:

@ErikBjare
Copy link
Member Author

ErikBjare commented Nov 15, 2023

Now added basic caching, which gets invalidated on page reload. Significantly speeds up browsing around different dates.

Also found a bunch of requests that weren't needed, reducing the total number of requests significantly.

We can consider persisting the cache with some expiry mechanism in the future, to make it reload past dates superfast, even after page reloads.

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

No branches or pull requests

1 participant