1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-13 20:28:44 +01:00

Bring back caching.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10316 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Andreas Fischer 2009-12-11 14:46:06 +00:00
parent 9189b8203a
commit c207c530b7
2 changed files with 22 additions and 18 deletions

View File

@ -112,6 +112,7 @@
<li>[Change] Log activation through inactive users ACP. (Bug #30145)</li>
<li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li>
<li>[Change] Use em dash instead of hyphen/minus as separator in ATOM Feeds item statistics. (Bug #53565)</li>
<li>[Change] Cache overall, forums, topics and news feeds for anonymous users and bots.</li>
</ul>
<a name="v305"></a><h3>1.ii. Changes since 3.0.5</h3>

View File

@ -443,7 +443,7 @@ class phpbb_feed_base
/**
* Default cache time of entries in seconds
*/
var $cache_time = 0;
var $cache_time = 90;
/**
* Separator for title elements to separate items (for example forum / topic)
@ -460,6 +460,14 @@ class phpbb_feed_base
*/
function phpbb_feed_base()
{
global $user;
// Disable cache if it is not a guest or a bot but a registered user
if ($this->cache_time && !empty($user) && $user->data['is_registered'])
{
$this->cache_time = 0;
}
$this->set_keys();
}
@ -562,18 +570,6 @@ class phpbb_feed_base
{
global $db, $cache;
// Disable cache if it is not a guest or a bot but a registered user
if ($this->cache_time)
{
global $user;
// We check this here because we call get_item() quite often
if (!empty($user) && $user->data['is_registered'])
{
$this->cache_time = 0;
}
}
if (!$this->cache_time)
{
if (empty($this->result))
@ -699,11 +695,6 @@ class phpbb_feed extends phpbb_feed_base
{
trigger_error('NO_TOPIC');
}
if (!$auth->acl_get('f_read', $this->forum_id))
{
trigger_error('SORRY_AUTH_READ');
}
}
else if ($this->forum_id)
{
@ -719,11 +710,18 @@ class phpbb_feed extends phpbb_feed_base
{
trigger_error('NO_FORUM');
}
}
// Topic/Forum feed
if ($this->topic_id || $this->forum_id)
{
if (!$auth->acl_get('f_read', $this->forum_id))
{
trigger_error('SORRY_AUTH_READ');
}
// Disable caching
$this->cache_time = 0;
}
}
@ -933,6 +931,11 @@ class phpbb_feed_forums extends phpbb_feed_base
class phpbb_feed_news extends phpbb_feed_base
{
/**
* Longer cache time for the news feed
*/
var $cache_time = 180;
function set_keys()
{
global $config;