Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.708
diff -u -p -r1.708 common.inc
--- includes/common.inc	25 Oct 2007 15:38:24 -0000	1.708
+++ includes/common.inc	26 Oct 2007 22:58:44 -0000
@@ -1638,6 +1638,11 @@ function drupal_get_css($css = NULL) {
   $no_theme_preprocess = '';
 
   $preprocess_css = variable_get('preprocess_css', FALSE);
+  if (is_null($css_timestamp = variable_get('css_timestamp', null))) {
+    $css_timestamp = time();
+    variable_set('css_timestamp', $css_timestamp);
+  }
+
   $directory = file_directory_path();
   $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
 
@@ -1646,6 +1651,7 @@ function drupal_get_css($css = NULL) {
     // Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones.
     foreach ($types as $type => $files) {
       foreach ($types[$type] as $file => $preprocess) {
+        $file.= '?'.$css_timestamp;
         if (!$preprocess || !($is_writable && $preprocess_css)) {
           // If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*,
           // regardless of whether preprocessing is on or off.
@@ -1665,7 +1671,7 @@ function drupal_get_css($css = NULL) {
     }
 
     if ($is_writable && $preprocess_css) {
-      $filename = md5(serialize($types)) .'.css';
+      $filename = md5(serialize($types).$css_timestamp) .'.css';
       $preprocess_file = drupal_build_css_cache($types, $filename);
       $output .= '<link type="text/css" rel="stylesheet" media="'. $media .'" href="'. base_path() . $preprocess_file .'" />'."\n";
     }
@@ -1736,6 +1742,7 @@ function drupal_build_css_cache($types, 
  */
 function drupal_clear_css_cache() {
   file_scan_directory(file_create_path('css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
+  variable_del('css_timestamp');
 }
 
 /**
@@ -1872,6 +1879,10 @@ function drupal_get_js($scope = 'header'
   $no_preprocess = array('core' => '', 'module' => '', 'theme' => '');
   $files = array();
   $preprocess_js = variable_get('preprocess_js', FALSE);
+  if (is_null($js_timestamp = variable_get('js_timestamp', null))) {
+    $js_timestamp = time();
+    variable_set('js_timestamp', $js_timestamp);
+  }
   $directory = file_directory_path();
   $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
 
@@ -1893,7 +1904,7 @@ function drupal_get_js($scope = 'header'
         // Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones.
         foreach ($data as $path => $info) {
           if (!$info['preprocess'] || !$is_writable || !$preprocess_js) {
-            $no_preprocess[$type] .= '<script type="text/javascript"'. ($info['defer'] ? ' defer="defer"' : '') .' src="'. base_path() . $path . ($info['cache'] ? '' : '?'. time()) ."\"></script>\n";
+            $no_preprocess[$type] .= '<script type="text/javascript"'. ($info['defer'] ? ' defer="defer"' : '') .' src="'. base_path() . $path . ($info['cache'] ? '?'. $js_timestamp : '?'. time()) ."\"></script>\n";
           }
           else {
             $files[$path] = $info;
@@ -1904,7 +1915,7 @@ function drupal_get_js($scope = 'header'
 
   // Aggregate any remaining JS files that haven't already been output.
   if ($is_writable && $preprocess_js && count($files) > 0) {
-    $filename = md5(serialize($files)) .'.js';
+    $filename = md5(serialize($files).$js_timestamp) .'.js';
     $preprocess_file = drupal_build_js_cache($files, $filename);
     $preprocessed .= '<script type="text/javascript" src="'. base_path() . $preprocess_file .'"></script>'."\n";
   }
@@ -2179,6 +2190,7 @@ function _packer_backreferences($match, 
 function drupal_clear_js_cache() {
   file_scan_directory(file_create_path('js'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
   variable_set('javascript_parsed', array());
+  variable_del('js_timestamp');
 }
 
 /**
