Hole punching Hyvä ViewModel category cache
We've been stumbled upon a cache issue we recently discovered in Hyva themes. All of a sudden our Tax Switcher for Magento 2 stopped working on few setups, it seems it didn't change price display in category pages and product listings.
After a lot of debugging, we found that this is related to how Hyvä product list ViewModel generates item cache. By examinging the ViewModel located here:
It seems that the getItemCacheKeyInfo() method does not include any values that could be dynamic per customer. It is build by using multiple criterias but it does not include the selected tax display settings.
This caused category pages to get cached and to not change price display depending on selected tax display by the customer. This issue could affect ANY third party module that is trying to generate dynamic cache key depending on additional criteria.
A fix for this may include direct modification of this method or an after plugin.