Q:

Is it possible to disable cache on certain fields? 

I am working on a site where i'm implementing my own cookie bar module. 
For this module i have made it possible to write something in the CKeditor like:

Where everything between the {cookie} tags is only visible when cookies are accepted.  This works fine on my dev environment, but when I deployed it to the test server where cache is enabled it won't show any change when you enable/disable cookies because the page is already cached. 
Is there a way to disable cache on the text field or better yet, everything between the cookie tag? 

A:

You need to adjust the cache context of the node. 
If the cookie is a drupal session, use the predefined cache context for this:
$build['#cache']['contexts'][] = 'session.exists';

If you target another cookie, that drupal is not aware of, you would need to create your own context, more info:
https://www.drupal.org/developing/api/8/cache/contexts

