I am trying to make product view block non cacheable so that on depending upon cart item count i can dynamically show some messages to user. The message is properly displaying when full page cache is disabled but not working when full page cache is enabled. I am using magento 2.1.8.
I would recommend taking a look at http://devdocs.magento.com/guides/v2.3/extension-dev-guide/cache/page-caching/public-content.html
of your could add
If content of your block is dynamic then you should mark block as $_isScopePrivate = true. and block will be deliver over Ajax.