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

[Lens] Client side caching #90945

Closed
flash1293 opened this issue Feb 10, 2021 · 3 comments
Closed

[Lens] Client side caching #90945

flash1293 opened this issue Feb 10, 2021 · 3 comments
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

flash1293 commented Feb 10, 2021

Currently Lens fetches new data on every configuration change, even if it's just visualization related. This is caused by the general architecture of Lens: Data fetching and rendering is done via expression and for every change the expression has to be run again which includes the esaggs function triggering an Elasticsearch request.

To improve response times for these kinds of changes, the data should be cached in the browser to avoid the additional round trip time of fetching data from the server.

Requirements:

  • Cache should be tied to the session id in some way - it's already controlled and reset in the right situations
  • To maximize cache hits (which should minimize total loading time), the request should be served from cache even if the expression args change (e.g. for labels), as long as the request itself doesn't change (stringified request is probably a good cache key)
  • A cache miss doesn't have a large impact, it's not necessary for the cache to survive browser refreshes or similar (can be occasionally unexpectedly reset due to external situations, e.g. too much cached data)
  • The cache doesn't have to be large, holding ~10 request/responses is good enough
  • It's likely the same request is submitted multiple times in a very short time frame (while the previous request is still in flight) - the cache should be able to handle this without failing (de-duping the request would be nice, but wouldn't have a large impact)
  • Not necessary for first iteration, but due to the user flow between dashboard and Lens, it would be helpful to be able to share the cache between apps so data doesn't have to be re-fetched after returning to the dashboard from editing a chart.
@flash1293 flash1293 added enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Feb 10, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor Author

cc @ppisljar @lukasolson

@flash1293
Copy link
Contributor Author

Requirements are met by #92439, closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants