How can I disable the cache for a specific page or have the cache ignore query params? I need to disable the cache for a specific page, or get the cache to ignore query params. I have tried this, but it does not disable the cache for me https://www.drupal.org/project/page_cache_query_ignore
After trying multiple ways to disable the cache for a specific page or even the whole site I have nothing that works.
I have tried all of these in settings.php
$settings['cache']['default'] = 'cache.backend.null';
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
$settings['cache']['bins']['page'] = 'cache.backend.null';
$settings['cache']['bins']['entity'] = 'cache.backend.null';

There is also talk of using \Drupal::service('page_cache_kill_switch')-&gt;trigger(); but I am unsure where to place this to disable the cache for a regular page.
This is for the search page, that uses query params for the search query. Drupal 8 is caching the page so each visit to the search after the first search always shows the results for the first search.
The header for Drupal dynamic cache is always a HIT
X-Drupal-Dynamic-Cache:    HIT
After a lot of trying and retrying I settled on the following solution
function mythemename_preprocess_page(&amp;$variables)
{
  if(isset($_SERVER['QUERY_STRING'])) {
    $params = \GuzzleHttp\Psr7\parse_query($_SERVER['QUERY_STRING']);
    if(isset($params['keys']) &amp;&amp; strlen($params['keys']) &gt; 0 &amp;&amp; preg_match('#^/search#', $_SERVER['REQUEST_URI'])) {
      \Drupal::service('page_cache_kill_switch')-&gt;trigger();
    }
  }
}

As far as I can tell, this stops the cache from working if the request is on the search page and there is a query parameter present named keys