Skip to content

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

@osdiab

Description

@osdiab

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions