diff --git a/contrib/search_api_views/includes/plugin_cache.inc b/contrib/search_api_views/includes/plugin_cache.inc
index 52724a0..6676d87 100644
--- a/contrib/search_api_views/includes/plugin_cache.inc
+++ b/contrib/search_api_views/includes/plugin_cache.inc
@@ -93,6 +93,7 @@ class SearchApiViewsCache extends views_plugin_cache_time {
         'super-user' => $user->uid == 1, // special caching for super user.
         'language' => $GLOBALS['language']->language,
         'base_url' => $GLOBALS['base_url'],
+        'current_page' => $this->view->get_current_page(),
       );
       // Not sure what gets passed in exposed_info, so better include it. All
       // other parameters used in the parent method are already reflected in the
diff --git a/contrib/search_api_views/includes/query.inc b/contrib/search_api_views/includes/query.inc
index d84a1ad..41af805 100644
--- a/contrib/search_api_views/includes/query.inc
+++ b/contrib/search_api_views/includes/query.inc
@@ -247,16 +247,6 @@ class SearchApiViewsQuery extends views_plugin_query {
     $view->init_pager();
     $this->pager->query();
 
-    // Views passes sometimes NULL and sometimes the integer 0 for "All" in a
-    // pager. If set to 0 items, a string "0" is passed. Therefore, we unset
-    // the limit if an empty value OTHER than a string "0" was passed.
-    if (!$this->limit && $this->limit !== '0') {
-      $this->limit = NULL;
-    }
-    // Set the range. (We always set this, as there might even be an offset if
-    // all items are shown.)
-    $this->query->range($this->offset, $this->limit);
-
     // Set the search ID, if it was not already set.
     if ($this->query->getOption('search id') == get_class($this->query)) {
       $this->query->setOption('search id', 'search_api_views:' . $view->name . ':' . $view->current_display);
@@ -314,6 +304,16 @@ class SearchApiViewsQuery extends views_plugin_query {
       // Trigger pager pre_execute().
       $this->pager->pre_execute($this->query);
 
+      // Views passes sometimes NULL and sometimes the integer 0 for "All" in a
+      // pager. If set to 0 items, a string "0" is passed. Therefore, we unset
+      // the limit if an empty value OTHER than a string "0" was passed.
+      if (!$this->limit && $this->limit !== '0') {
+        $this->limit = NULL;
+      }
+      // Set the range. (We always set this, as there might even be an offset if
+      // all items are shown.)
+      $this->query->range($this->offset, $this->limit);
+
       $start = microtime(TRUE);
 
       // Execute the search.
