public static function invalidateGroup($name=null, $recursive=true) {
		//if invalidating a group, make sure it's valid
		if($name) {
			//it needs to have a trailing slash and no leading slashes
			$name = trim($name,'/').'/';

			//make sure the key isn't going up a directory
			if(strpos($name,'..') !== false) {
				throw new Exception("Invalidate path cannot go up directories.");
			}
		}

		array_map("unlink", glob(self::$cacheDir.'/'.$name.'*.cache'));
		
		//if recursively invalidating
		if($recursive) {
			$subdirs = glob(self::$cacheDir.'/'.$name.'*',GLOB_ONLYDIR);
			
			foreach($subdirs as $dir) {
				$dir = basename($dir);
				
				//skip all subdirectories that start with '.'
				if($dir[0] == '.') continue;
				
				self::invalidateGroup($name.$dir,true);
			}
		}
	}