How can I prevent a specific node - or a list of specific nodes - being cached server-side in Drupal 8?
I have page that pulls a value out of a $_SESSION variable using a PHP text block, and it is being cached, which is obviously not what I want.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
I fixed this by doing the following:
'url.query_args'cache context to the
It puts a bit more strain on the memory use of the cache than just keeping it out of cache altogether, but the
\Drupal::service('page_cache_kill_switch')->trigger(); line did not do anything for me at all.
I think it makes sense for the querystring to be part of the default cache context anyway.