Cached rendering depending on a parameter
Add the cache context url.query_args in preprocess:

function themename_preprocess_page(&amp;$variables) {
  $variables['#cache']['contexts'][] = 'url.query_args';


Or more specific:

  $variables['#cache']['contexts'][] = 'url.query_args:step';