8 – Invalid paragraph cache

I am working on a paragraph type that needs to be displayed on a very limited number of pages, but has certain functions that require the preprocessing feature to be executed each time.

In my preprocessing function, I tried several of the following iterations:

$variables('elements')('#cache')('max-age') = '0';
$variables('elements')('#cache')('contexts')() = 'url.path';
$variables('elements')('#cache')('contexts')() = 'url.query_args:r';
$variables('elements')('#cache') = ('tags' => ('my_paragraph'));
Cache::invalidateTags(('my_paragraph'));
Drupal::service('page_cache_kill_switch')->trigger();

However, the preprocessing function will be executed once after clearing the cache and will not be executed again.

what am I doing wrong here? How can I do this every time?