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

[FEATURE] idea: stale-while-revalidate for secrets #423

Open
osdiab opened this issue Jul 20, 2023 · 0 comments
Open

[FEATURE] idea: stale-while-revalidate for secrets #423

osdiab opened this issue Jul 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@osdiab
Copy link

osdiab commented Jul 20, 2023

Is your feature request related to a problem? Please describe.
Checking for new secrets every time we run commands just makes running every command slower; it has to do a round trip to Doppler. But secrets only change occasionally in our project, so it would be more valuable to have our commands run speedily than to always have the freshest secrets.

Describe the solution you'd like
Similarly to "stale-while-revalidate" when caching content on the web, give the Doppler CLI an option to just use the secrets from whatever it retrieved last time (so long as it's not too egregiously stale, maybe make it configurable the same way that SWR is), and in the background refresh the secrets so that at least the next time you run the command, if something changed it would be up-to-date.

So the command would run near instantly, but you run the risk of running it with stale values once.

Might be good to additionally have some explicit "refresh" command alongside this when needed.

Describe alternatives you've considered
Turning the internet off and using the fallback? lol or just tolerating all our CLI commands stalling for a second before we do anything. But that makes Doppler less fun.

Additional context
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate

@osdiab osdiab added the enhancement New feature or request label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant