--- quicktabs.orig 2011-03-26 19:40:53.000000000 +0530 +++ quicktabs.module 2011-03-26 21:51:22.000000000 +0530 @@ -512,14 +512,27 @@ if (module_exists('views')) { if ($view = views_get_view($tab['vid'])) { if ($view->access($tab['display'])) { - $view->set_display($tab['display']); - $view->set_arguments($tab['args']); - $view_output = $view->preview(); - if (!empty($view->result) || $view->display_handler->get_option('empty') || !empty($view->style_plugin->definition['even empty'])) { - $output = $view_output; + // Check if the view has pager enabled ... + $current_page = ''; + if ($view->display[$tab['display']]->display_options['use_pager']) { + // If it is, then get the current page number + $current_page = $_GET['page']; + } + $cid = $tab['vid'] . ':' . $tab['display'] . ':' . implode(',', $tab['args']) .':'. $current_page; + if ($views_cache = cache_get($cid, 'cache_block')) { + $output = $views_cache->data; } else { - $output = ''; + $view->set_display($tab['display']); + $view->set_arguments($tab['args']); + $view_output = $view->preview(); + if (!empty($view->result) || $view->display_handler->get_option('empty') || !empty($view->style_plugin->definition['even empty'])) { + $output = $view_output; + } + else { + $output = ''; + } + cache_set($cid, $output, 'cache_block', time() + 5*60); } } elseif (!$hide_empty) {