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

feat: Use HTTP statuses to backoff when needed #192

Open
chriswk opened this issue Jan 10, 2024 · 3 comments
Open

feat: Use HTTP statuses to backoff when needed #192

chriswk opened this issue Jan 10, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@chriswk
Copy link
Contributor

chriswk commented Jan 10, 2024

Describe the feature request

In order to reduce load on servers, as well as save our users some bandwidth, I'd like for this SDK to react to http status codes, and not just keep requesting at the same frequency if the server is telling it to chill out.

Background

Part of a cross-SDK initiative to make all our SDKs respect http statuses in order to save ourselves and our users for bandwidth/cpu usage that adds no value to either the server or the client.

Solution suggestions

Unleash/unleash-client-node#537 follows the correct pattern. Use 404, 429 or 50x statuses to reduce polling frequency. On 401 or 403 log and don't keep polling - your user probably needs to update their key before there's any point in continuing to hit the server.

@chriswk chriswk added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 10, 2024
@RikudouSage
Copy link
Collaborator

RikudouSage commented Jan 10, 2024

This might be a little harder than in other SDKs because PHP (the way it's commonly used in web environments) doesn't use any shared state, meaning no variables persist across requests and thus detecting when the app has been redeployed (and the changes to the frequency should be reset to configured values) is hard.

Copy link

stale bot commented Mar 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 9, 2024
@stale stale bot closed this as completed Mar 19, 2024
@RikudouSage RikudouSage reopened this Apr 3, 2024
@stale stale bot removed the stale label Apr 3, 2024
Copy link

stale bot commented May 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 4, 2024
@RikudouSage RikudouSage removed the stale label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Archived in project
Development

No branches or pull requests

2 participants