[ticket/644] Reduce caching time on portal page
B3P-644
This commit is contained in:
@@ -225,7 +225,7 @@ class announcements extends module_base
|
|||||||
AND topic_moved_id = 0
|
AND topic_moved_id = 0
|
||||||
' . $post_time . '
|
' . $post_time . '
|
||||||
' . $str_where;
|
' . $str_where;
|
||||||
$result = $this->db->sql_query($sql, 300);
|
$result = $this->db->sql_query($sql, 30);
|
||||||
$total_announcements = (int) $this->db->sql_fetchfield('num_topics');
|
$total_announcements = (int) $this->db->sql_fetchfield('num_topics');
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class birthday_list extends module_base
|
|||||||
'ORDER BY' => $order_by,
|
'ORDER BY' => $order_by,
|
||||||
);
|
);
|
||||||
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
$result = $this->db->sql_query($sql, 3600);
|
$result = $this->db->sql_query($sql, 300);
|
||||||
$today = sprintf('%2d-%2d-', $now['mday'], $now['mon']);
|
$today = sprintf('%2d-%2d-', $now['mday'], $now['mon']);
|
||||||
|
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class news extends module_base
|
|||||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||||
AND topic_moved_id = 0
|
AND topic_moved_id = 0
|
||||||
' . $str_where;
|
' . $str_where;
|
||||||
$result = $this->db->sql_query($sql, 300);
|
$result = $this->db->sql_query($sql, 30);
|
||||||
$total_news = (int) $this->db->sql_fetchfield('num_topics');
|
$total_news = (int) $this->db->sql_fetchfield('num_topics');
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,14 +263,14 @@ class fetch_posts
|
|||||||
$sql_array['SELECT'] .= ', tp.topic_posted';
|
$sql_array['SELECT'] .= ', tp.topic_posted';
|
||||||
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
|
|
||||||
// Cache queries for 10 minutes
|
// Cache queries for 30 seconds
|
||||||
if ($number_of_posts != 0)
|
if ($number_of_posts != 0)
|
||||||
{
|
{
|
||||||
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start, 600);
|
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start, 600);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $this->db->sql_query($sql, 600);
|
$result = $this->db->sql_query($sql, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
Reference in New Issue
Block a user