More efficient forum, was Re: [midgard-dev] QB count method

Henri Bergius <henri.bergius-ZpG/[email protected]> Wed, 22 Feb 2006 22:23:43 +0200
Newsgroups gmane.comp.web.midgard.devel
Message-ID <[email protected]>
On Feb 22, 2006, at 19:17, Piotras wrote:
>> Is there any way to make this more efficient?
> Make 1.8 release beta quality ASAP.

Not really an option, we need to launch this particular site next  
week. And these load times are just not acceptable...

I could make the queries faster by reverting to reply articles and  
using the old API, but I don't want to do that. So I'm going for the  
other option: aggressive caching.

## Thread listing

The thread listing can be made more efficient using the following  
methods:
   * Page the listing using the org.openpsa.qbpager library
     (not that big advantage since limit and offset are coming from  
PHP level)
   * Cache the number of posts into the thread
   * Cache either the latest post GUID or basic info (poster, title,  
date) into
     the thread

Thread ordering will happen based on thread revised timestamps. When  
a new reply is made, it will update its thread (to add the caching  
information).

## Sticky threads

If we want to support sticky threads (i.e. threads that are always  
first in the list), this can be done easily by another QB run made on  
the first page.

## Posts in a thread

Inside a thread things will be relatively simple as we will be just  
showing a list of posts into that thread, paged and arranged in  
creation order.

## Moderation

Moderation will be handled by changing the status number of posts.  
This way we can easily filter out "reported spam" from listings, etc.

## New replies

Some forums have a nice feature that the forum remembers for  
authenticated users what they've seen. This we could handle by  
storing the timestamps when a thread was read into the person's (or  
the thread's) parameters. Then the thread listing would have a "New"  
button next to each thread with newer posts. This button would link  
to a "redirection URL" that would calculate which page of the thread  
to direct the user to. Something like /unseen/threadname.html that  
redirects to somewhere like /threadname/20.html#new

## Replies and quoting

Each thread will be flat normally, i.e. shown in chronological order  
just like for example phpBB does it. However, we will also store the  
"in reply to" information so that we can handle quoting, and "replies  
to your posts" more nicely.

Each post will have a "Reply" button next to it that will populate  
the comment editor with information from that post, and will also  
populate the "in reply to" param.

## Comment formatting

We will be using Markdown by default, with a filter for tuning down  
the allowed HTML.

## User profiles

I'll use org.openpsa.contactwidget for poster "avatar" display, and  
net.nehmer.account can be used for details if needed.

## RSS feeds

Feeds will be powered by de.bitfolge.feedcreator. I'm planning to  
have both whole forum and per-thread feeds.

Note, I was looking at http://www.flightforum.fi/forum/index.php when  
compiling this list. Please comment, especially on the optimization  
points. The grand plan is to be able to manage huge list archives  
like midgard-user through this.

> Piotras

/Bergie

Henri Bergius
Consultant Partner, Nemein
henri.bergius-ZpG/[email protected]

Midgard CMS
www.midgard-project.org