For test purposes with magento 2.2 there was form created which task is simply to store some text in database and all these messages should be shown at same page above that form as list.
So the problem is that after saving magento displays the old list without the newly added message and as it turned out the problem in the cache, namely in the full page cache i.e if you reset it then absolutely all the messages will be displayed.
The form was made by absolute analogy with the feedback form from
vendor/magento/module-contact. The only solution that I have found is to call
$this->cacheTypeList->cleanType('full_page'); after successfully saving to the
database (where cacheTypeList is an object with an interference \Magento\Framework\App\Cache\TypeListInterface from the constructor)
And the question arises is it right way and how to act if not? (To clean all cache obviously somehow not really, I suspect that there has to be a method of cleaning of cache only of a specific page)