Clearing all caches in Drupal should have the result that no browser uses old cached javascript files. The Drupal way of doing this is adding a cache busting token to the url of the javascript file, as a querystring. Drupal provides a variable for this. It can be retrieved like this: variable_get('css_js_query_string', '')

So, for example, in ckeditor.lib.inc, you should replace this code

  if (!empty($conf['theme_config_js']) && $conf['theme_config_js'] == 't' && file_exists($themepath . 'ckeditor.config.js')) {
    $ckeditor_config_path = $host . $themepath . 'ckeditor.config.js?' . @filemtime($themepath . 'ckeditor.config.js');
  }
  else {
    $ckeditor_config_path = $module_drupal_path . "/ckeditor.config.js?" . @filemtime($module_drupal_path . "/ckeditor.config.js");
  }

with this:

  if (!empty($conf['theme_config_js']) && $conf['theme_config_js'] == 't' && file_exists($themepath . 'ckeditor.config.js')) {
    $ckeditor_config_path = $host . $themepath . 'ckeditor.config.js?' . variable_get('css_js_query_string', '');
  }
  else {
    $ckeditor_config_path = $module_drupal_path . "/ckeditor.config.js?" . variable_get('css_js_query_string', '');
  }

Comments

jcisio’s picture

I think it is generally better to use drupal_add_js as having pointed out in #1966798: Replace usage of ckeditor_path('url') with drupal_add_js to avoid messing with Drupal internals.

Also, it does not solve the broader problem: everytime you modify your JS, or update the library, the cache is not flushed. As a result: #2147155: Icons are broken with 4.3 library.

rosell.dk’s picture

Ok, sounds sensible. I guess the issue I'm actually concerned with is that a Drupal "flush all caches" have no effect. Using drupal_add_js() to include javascript files as suggested in #1 will fix that issue