Index: wp-includes/cache.php
===================================================================
--- wp-includes/cache.php	(revision 5482)
+++ wp-includes/cache.php	(working copy)
@@ -1,5 +1,5 @@
 <?php
-function wp_cache_add($key, $data, $flag = '', $expire = 0) {
+function wp_cache_add($key, $data, $flag = '', $expire = '') {
 	global $wp_object_cache;
 	$data = unserialize(serialize($data));
 
@@ -36,14 +36,14 @@
 	$GLOBALS['wp_object_cache'] =& new WP_Object_Cache();
 }
 
-function wp_cache_replace($key, $data, $flag = '', $expire = 0) {
+function wp_cache_replace($key, $data, $flag = '', $expire = '') {
 	global $wp_object_cache;
 	$data = unserialize(serialize($data));
 
 	return $wp_object_cache->replace($key, $data, $flag, $expire);
 }
 
-function wp_cache_set($key, $data, $flag = '', $expire = 0) {
+function wp_cache_set($key, $data, $flag = '', $expire = '') {
 	global $wp_object_cache;
 	$data = unserialize(serialize($data));
 
@@ -57,6 +57,7 @@
 	var $cache_dir;
 	var $cache_enabled = false;
 	var $expiration_time = 900;
+	var $expire_in = array();
 	var $flock_filename = 'wp_object_cache.lock';
 	var $mutex;
 	var $cache = array ();
@@ -146,7 +147,7 @@
 			return false;
 		}
 
-		$cache_file = $this->cache_dir.$this->get_group_dir($group)."/".$this->hash($id).'.php';
+		$cache_file = $this->cache_dir . $this->get_group_dir($group) . DIRECTORY_SEPARATOR . $this->hash($id) . '.php';
 		if (!file_exists($cache_file)) {
 			$this->non_existant_objects[$group][$id] = true;
 			$this->cache_misses += 1;
@@ -155,8 +156,7 @@
 
 		// If the object has expired, remove it from the cache and return false to force
 		// a refresh.
-		$now = time();
-		if ((filemtime($cache_file) + $this->expiration_time) <= $now) {
+		if ( filemtime($cache_file) <= time() ) {
 			$this->cache_misses += 1;
 			$this->delete($id, $group, true);
 			return false;
@@ -174,7 +174,7 @@
 		if (false !== array_search($group, $this->global_groups))
 			return $group;
 
-		return "{$this->blog_id}/$group";
+		return $this->blog_id . DIRECTORY_SEPARATOR . $group;
 	}
 
 	function hash($data) {
@@ -201,8 +201,8 @@
 	function make_group_dir($group, $perms) {
 		$group_dir = $this->get_group_dir($group);
 		$make_dir = '';
-		foreach (split('/', $group_dir) as $subdir) {
-			$make_dir .= "$subdir/";
+		foreach (explode(DIRECTORY_SEPARATOR, $group_dir) as $subdir) {
+			$make_dir .= $subdir . DIRECTORY_SEPARATOR;
 			if (!file_exists($this->cache_dir.$make_dir)) {
 				if (! @ mkdir($this->cache_dir.$make_dir))
 					break;
@@ -216,7 +216,7 @@
 			}
 		}
 
-		return $this->cache_dir."$group_dir/";
+		return $this->cache_dir . $group_dir . DIRECTORY_SEPARATOR;
 	}
 
 	function rm_cache_dir() {
@@ -275,12 +275,16 @@
 		if (empty ($group))
 			$group = 'default';
 
+		if( empty($expire) )
+			$expire = $this->expiration_time;
+		
 		if (NULL == $data)
 			$data = '';
 
 		$this->cache[$group][$id] = $data;
 		unset ($this->non_existant_objects[$group][$id]);
 		$this->dirty_objects[$group][] = $id;
+		$this->expire_in[$group][$id] = $expire;
 
 		return true;
 	}
@@ -345,6 +349,7 @@
 					@ unlink($temp_file);
 				}
 				@ chmod($cache_file, $file_perms);
+				@ touch($cache_file, time() + $this->expire_in[$group][$id] );
 			}
 		}
 
@@ -377,8 +382,8 @@
 				echo "<pre>";
 				print_r(array_unique($this->dirty_objects[$group]));
 				echo "</pre>";
-				echo "</p>";
 			}
+			echo "</p>";
 		}
 	}
 
@@ -401,6 +406,13 @@
 		if ( ini_get('safe_mode') && ! defined('ENABLE_CACHE') )
 			return;
 
+		if ( ! defined( 'DIRECTORY_SEPARATOR' ) ) {
+			if ( strpos( $_ENV[ 'OS' ], 'Win' ) !== false )
+				define( 'DIRECTORY_SEPARATOR', '\\' );
+			else 
+				define( 'DIRECTORY_SEPARATOR', '/' );
+		}
+
 		if (defined('CACHE_PATH'))
 			$this->cache_dir = CACHE_PATH;
 		else
