Modifying/updating secrets from Worker
Quick question, can you update a secret/environment variable from within a worker and propagate it so it's up-to-date on the next request? (important that it's a secret)
2 Replies
What kind of data consistency are you expecting? You'll need to choose some kind of persistent storage e.g. KV, D1, Durable Object if you want to dynamically update data in a worker. It may be possible to keep a global variable around in your worker but there's no data consistency guarantee here.
If you mean update the literal secret/env of a Worker, that'd require a Worker Deploy, and Worker Deploys can take anywhere from less then a second on average, to 30 mins-hours in incidients/rare cases