diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0ee193d966..55d45965eb 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -112,6 +112,7 @@
  • [Change] Log activation through inactive users ACP. (Bug #30145)
  • [Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)
  • [Change] Use em dash instead of hyphen/minus as separator in ATOM Feeds item statistics. (Bug #53565)
  • +
  • [Change] Cache overall, forums, topics and news feeds for anonymous users and bots.
  • 1.ii. Changes since 3.0.5

    diff --git a/phpBB/feed.php b/phpBB/feed.php index 83875f5843..e644afe642 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -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;