Update DynamicSupervisor's children config

I have a DynamicSupervisor that spawns multiple workers and provides them with a configuration. I want to be able to update this configuration so that when a worker crashes and is restarted, it uses the new configuration. I don’t want to restart these workers manually. I considered not passing the configuration directly when starting a worker, but instead storing it in an Agent or ETS and having the worker read it upon being spawned. Is there a better way to achieve this?