How can I stop full page HTML from being cached? I am having an issue with my whole page's HTML being cached. This is getting in the way of some dynamic block content that is based off of a user preference value (both authenticated and anonymous users).

I have located the cache entry in the cache_render table of the DB and it has a CID of:

http://dev-mysite.pantheonsite.io/:html


(this would be the entry for the front page)
I do have the block that builds this dynamic content configured with cache settings:

[#cache]['contexts'] = ['session', 'user'];
[#cache]['max-age'] = 0;


I am only having this caching issue when code is push to the Pantheon servers, local development environments with default cache config settings do not have this issue.
(Anyonymous) Page cache can not be controlled by max-age or contexts. You need to call \Drupal::service('page_cache_kill_switch')->trigger(); to prevent that kind of caching.

However, if it is a block that is displayed on all pages, then that becomes pretty pointless to even try and you could uninstall the page_cache module completely.