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

[SO Tagging] improve the browser-side cache mechanism #160751

Open
pgayvallet opened this issue Jun 28, 2023 · 3 comments
Open

[SO Tagging] improve the browser-side cache mechanism #160751

pgayvallet opened this issue Jun 28, 2023 · 3 comments
Assignees
Labels
discuss Feature:Saved Object Tagging Saved Objects Tagging feature Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@pgayvallet
Copy link
Contributor

At the moment, the SO tagging plugin fetches the tags at a fixed interval (15mins by default)

This was mostly driven by technical constraints, as the places where the feature was integrated in other applications (e.g dashboard) did not support async loading, so we had to keep an up-to-date cache with synchronous access.

this.tagCache = new TagsCache({
refreshHandler: () => this.tagClient!.getAll({ asSystemRequest: true }),
refreshInterval: this.config.cacheRefreshInterval,
});
this.tagClient = new TagsClient({ http, changeListener: this.tagCache });

However, this approach creates a few problems:

  • lot of traffic: any session kept open will continue requesting the tags at this fixed interval, even if no user is actively using the session / tab
  • errors: it will continue trying to fetch the tags even if the server is down, generating errors in the proxies

Ideally, we would find a way to stop using a cache and load the list on-demand when an application needs it. However, this may be quite challenging, given the places SOT is integrated (e.g dash/vis edition popins)

If this can't be done, then we should at least look at solutions to limit the problems:

  • Increasing the default cache_refresh_interval value?
  • Detecting when a browser session is active/inactive and only fetch when the session is active?
  • Others?
@pgayvallet pgayvallet added Feature:Saved Object Tagging Saved Objects Tagging feature Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Jun 28, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@sebelga
Copy link
Contributor

sebelga commented Jun 29, 2023

We don't have on our roadmaps Server-Sent events or any other pushing mechanism right ?

@pgayvallet
Copy link
Contributor Author

AFAIK, there isn't any active discussions about SSE/WS or other pushing systems right now, at least from Core's side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:Saved Object Tagging Saved Objects Tagging feature Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

No branches or pull requests

6 participants