8 – Invalidate cache in sending ConfigFormBase


I have a ConfigFormBase called TextConfiguration where I have defined various fields for the address, phone number etc.

These variables are displayed in the contact form on my website. When I modify them and anonymously enter / contact, the value is not updated.

I have tried this in submitting my ConfigFormBase form, but it doesn't work.

// Additionally, clear cache to prevent mismatch data.
$tags = $this->config(static::COMPET_SETTINGS)->getCacheTags();
if ($tags) {
  Cache::invalidateTags($tags);
}

I am doing something wrong? Do I need to configure or do something to update the data when a value is changed? Thank you all!

Edit: Example of how I render the fields.

enter the image description here