Project list expiration was using the wrong cache key
Project list expiration was using the wrong cache key

--- a/include/controller/ControllerBase.class.php
+++ b/include/controller/ControllerBase.class.php
@@ -121,9 +121,10 @@
 	 * Get the prefix for all cache keys
 	 *
 	 * @access private
+	 * @param string $projectKeys include project-specific key pieces
 	 * @return string cache key prefix
 	 */
-	private function GetCacheKeyPrefix()
+	private function GetCacheKeyPrefix($projectKeys = true)
 	{
 		$cacheKeyPrefix = GitPHP_Resource::GetLocale();
 
@@ -132,7 +133,7 @@
 			$cacheKeyPrefix .= '|' . sha1(serialize($projList->GetConfig()));
 			unset($projList);
 		}
-		if ($this->project) {
+		if ($this->project && $projectKeys) {
 			$cacheKeyPrefix .= '|' . sha1($this->project->GetProject());
 		}
 		
@@ -333,7 +334,7 @@
 			$age = $headList[0]->GetCommit()->GetAge();
 
 			$this->tpl->clear_cache(null, $this->GetCacheKeyPrefix(), null, $age);
-			$this->tpl->clear_cache('projectlist.tpl', sha1(serialize(GitPHP_ProjectList::GetInstance()->GetConfig())), null, $age);
+			$this->tpl->clear_cache('projectlist.tpl', $this->GetCacheKeyPrefix(false), null, $age);
 		}
 	}
 

comments