How do I avoid having to clear the cache when changing a module configuration parameter?
You need to set the cache tag to invalidate your output if the configuration changes. That's as easy as adding this to your render array:

$element['#cache']['tags'] = $config-&gt;getCacheTags();