[ticket/494] Cache more queries on portal page

B3P-494
This commit is contained in:
Marc Alexander
2015-03-03 15:25:22 +01:00
parent a699a92e31
commit 1e405e9d91
13 changed files with 55 additions and 62 deletions

View File

@@ -19,7 +19,7 @@ class fetch_posts
/**
* phpBB cache
* @var \phpbb\cache\driver
* @var \phpbb\cache\driver\driver_interface
*/
protected $cache;
@@ -31,7 +31,7 @@ class fetch_posts
/**
* phpBB db driver
* @var \phpbb\db\driver_interface
* @var \phpbb\db\driver\driver_interface
*/
protected $db;
@@ -263,13 +263,14 @@ class fetch_posts
$sql_array['SELECT'] .= ', tp.topic_posted';
$sql = $this->db->sql_build_query('SELECT', $sql_array);
// Cache queries for 10 minutes
if ($number_of_posts != 0)
{
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start);
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start, 600);
}
else
{
$result = $this->db->sql_query($sql);
$result = $this->db->sql_query($sql, 600);
}
return $result;