diff --git a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php index d042176d099..703ea49a9cd 100644 --- a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php +++ b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php @@ -55,10 +55,13 @@ class CssCollectionRenderer implements AssetCollectionRendererInterface { switch ($css_asset['type']) { // For file items, output a LINK tag for file CSS assets. case 'file': - // The dummy query string needs to be added to the URL to control - // browser-caching. - $query_string_separator = (strpos($css_asset['data'], '?') !== FALSE) ? '&' : '?'; - $element['#attributes']['href'] = file_url_transform_relative(file_create_url($css_asset['data'])) . $query_string_separator . $query_string; + $element['#attributes']['href'] = file_url_transform_relative(file_create_url($css_asset['data'])); + // Only add the cache-busting query string if this isn't an aggregate + // file. + if (!isset($css_asset['preprocessed'])) { + $query_string_separator = (strpos($css_asset['data'], '?') !== FALSE) ? '&' : '?'; + $element['#attributes']['href'] .= $query_string_separator . $query_string; + } break; case 'external':