--- library/Zend/Paginator.php	(revision 21731)
+++ library/Zend/Paginator.php	(working copy)
@@ -93,13 +93,20 @@
     protected static $_cache;
 
     /**
-     * Enable or desable the cache by Zend_Paginator instance
+     * Enable or disable the cache by Zend_Paginator instance
      *
      * @var bool
      */
     protected $_cacheEnabled = true;
 
     /**
+     * Internal cache id.
+     * 
+     * @var string
+     */
+    protected $_cacheInternalId = null;
+    
+    /**
      * Adapter
      *
      * @var Zend_Paginator_Adapter_Interface
@@ -1008,7 +1015,12 @@
      */
     protected function _getCacheInternalId()
     {
-        return md5(serialize($this->getAdapter()) . $this->getItemCountPerPage());
+    	// Can't rely on adapter internal state not changing, so compute the id just once (ZF-6989)
+    	if ($this->_cacheInternalId === null) {
+        	$this->_cacheInternalId = md5(serialize($this->getAdapter()) . $this->getItemCountPerPage());
+    	}
+    	
+    	return $this->_cacheInternalId;
     }
 
     /**

