Skip to content

Consider changing the default value of refreshInterval so it is less spammy #247

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

Closed
rcjsuen opened this issue Apr 15, 2025 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@rcjsuen
Copy link

rcjsuen commented Apr 15, 2025

Describe the feature request

refreshInterval = 30,

Currently, this library uses a default of 30s for the refreshInterval. If you just move ahead with the defaults (without thinking much about it) and release your code, you may end up getting a swarm of requests to your backend. Would Unleash consider changing the default to 60s or 5m or whatever else seems "reasonable" (although I completely understand that "reasonable" is subjective).

I understand that there's another side to the coin here. You want to refresh regularly so that if something goes wrong you want to be able to change the state of a flag quickly to protect your users as soon as possible.

Background

No response

Solution suggestions

No response

@rcjsuen rcjsuen added the enhancement New feature or request label Apr 15, 2025
@gastonfournier
Copy link
Contributor

Hi @rcjsuen, the refresh interval is configurable via options: https://docs.getunleash.io/reference/sdks/javascript-browser#available-options. In general, 30 seconds is the best we've found.

I can understand it might be a problem if you have a massive amount of clients, but in those cases we see people being detailed-oriented and tweaking these configurations. But for small setups it works well and can be adapted as you scale.

We're also trying to align and standardize our default refresh intervals, but based on the current setup of different SDKs: https://docs.getunleash.io/reference/sdks#client-side-sdks-1 I'm inclined to think that 30s is going to be our default.

I'll close this, as I feel this resolves the question, but feel free to re-open or respond if you want to follow up.

And thanks for the feedback! I'll make sure our team is aware of it.

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
Status: Done
Development

No branches or pull requests

2 participants