I'm wondering how to disable css caching when you use the function drupal_add_css. In hook_preprocess I have some dynamic css loading with this function and by default it generates a cached version of the css file (f.e. style.css?ow65jm) and I couldn't find any information on how to disable this. It gives an issue with some third party applications how rebuild a page view (f.e. Hotjar) who expect a single version of an certain file.
I've checked the performance settings (admin/config/development/performance) and CSS and JS merge/compression is disabled.
Adding the CSS files directly into the tpl files can fixes this but can this also be accomplished with in the preprocess hook and with the drupal_add_css function.
Update - Added template.php and .tpl code:
template.php:
function mytheme_preprocess(&$vars, $hook) {
...
if (!(path_is_admin(current_path())) || (arg(0) == 'user' && arg(2) == 'edit')) {
drupal_add_css('https://fonts.googleapis.com/css?family=Merriweather:700', array('type' => 'external'));
drupal_add_css( $path_odisee . '/css/normalize.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'weight' => -10));
drupal_add_css( $path_odisee . '/css/odisee.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'weight' => 0));
drupal_add_css( $path_odisee . '/css/override.css', array('group' => CSS_THEME, 'every_page' => TRUE, 'weight' => 0));
}
...
}
html.tpl.php:
...
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<?php print $styles; ?> <!-- here the preprocessed CSS gets loaded -->
</head>
...
Additional information: The people over at Hotjar suggested to keep the cached versions of the css files on the server. Any suggestion on how to force this?
You can disable responsive capability using the theme settings - look under the Global settings.