Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8806 now.

Broken cache behavior in feed.php (fix completed in vcs)

This was found in 3.0.6-RC3's feed.php. It looks to me like the version in SVN trunk (http://code.phpbb.com/svn/phpbb/trunk/phpBB/feed.php) has the same issue.

Incorrect results are served if you fetch multiple individual forum/topic feeds within $cache_time. I.e. fetch feed.php?f=1, feed.php?f=2, feed.php?f=3, ... within cache_time, and all will contain the same data. This only applies to anon/guests, as the cache is auto-inhibited for logged in users. I _think_ it applies to bots too.

Very quick workaround (not ideal): $cache_time=0;

Most obvious fix that springs to mind, in phpbb_feed::get_item():

Find:
Code: Select all
                                // Try to load result set...
                                $cache_filename = substr(get_class($this), strlen('phpbb_'));

Add:
Code: Select all
                                if (!$this->topic_id && $this->forum_id)
                                {
                                        $cache_filename .= '_forum_' . $this->forum_id;
                                }
                                else if ($this->topic_id)
                                {
                                        $cache_filename .= '_topic_' . $this->topic_id;
                                }


This does raise the issue of potentially creating a very large number of files in the cache directory, which is not exactly ideal, but retaining caching without creating so many files would need quite a bit more work - that's the quick fix and should be ok on smaller boards, I'd guess.

One relatively obvious way of addressing the number of cache files would be to store the results in a simple (forum_id, topic_id, timestamp, data) DB table.

Comments / History

Edited ticket

Action performed by Paul.J.Murphy (QA Team) on Oct 19th 2009, 18:50

Marked ticket #53055 as duplicate of this ticket

Action performed by ToonArmy (Development Team Member) on Oct 19th 2009, 18:59

Changed ticket severity from "Uncategorised/normal" to "Severe"

Action performed by ToonArmy (Development Team Member) on Oct 19th 2009, 18:59

Assigned ticket to user "Acyd Burn"

Action performed by ToonArmy (Development Team Member) on Oct 19th 2009, 18:59

Posted by Acyd Burn (Server Manager) on Oct 20th 2009, 10:15

You are of course right - i do not know what i thought when doing it this way. :o

I will set the cache_time to 0 for phpBB 3.0.6 and have a look at it later. Doing proper caching there involves indeed quite a bit of changes.

Linked ticket with changeset: r10225

Action performed by Acyd Burn (Server Manager) on Oct 20th 2009, 11:04

Changed ticket status from "New" to "Fix completed in SVN"

Action performed by Acyd Burn (Server Manager) on Oct 20th 2009, 11:07

Ticket details

Duplicates of this ticket

Related SVN changesets