From: Lee Daniel Crocker <lee(a)piclab.com>
One things that would be nice is if the HTTP connection could be
dropped immediately after sending and before those database updates.
That's easy to do with threads in Java Servlets, but I haven't
found any way to do it with Apache/PHP.
:P No, I looked into exactly this problem in connection with my own little
project (improved Special:Movepage). PHP and threads don't mix. As far as I
could see, the PHP subprocess has to exit (taking all threads with it)
before Apache will drop the connection. Like Brion said, you'd have to set
up another process, and use PHP's poorly documented IPC functions. As for
what improvement it would achieve: it wouldn't reduce database load per
view, it would just allow users to hit more pages sooner.
I think caching HTML is the way to go, in the short term. If people don't
want to code something complicated, you could ignore user preferences for
now and only cache pages for "anonymous" users. The cached version could
leave little notes in the HTML like
<strong>Isaac Newton</strong> was a
<<WIKILINK[[physics|physicist]]>> born
in...
and maybe
<<USERIP>> (<a href
="http://www.wikipedia.org/wiki/User_talk:<<USERIP>>"
class='internal' title="User
talk:<<USERIP>>">Talk</a>
Then a cache processing script would look up the link table and replace the
links with real HTML. I imagine looking up the link table is much, much
faster than looking up cur_text. Plus the cached text would be stored on the
web server, thereby distributing disk load more evenly.
As for invalidation, the easiest, and possibly ugliest way I can think of is
implementing it in wfQuery() *cringe*. That's a very simple function with
very diverse uses, but every single update query passes through that point.
Just use a hash table (always in RAM) to store the article name of every
cache entry, and remove the rows when they're invalidated.
There'd also have to be a check for an altered user talk page. This could be
handled with another of my <<TAGS>>.
This idea is likely to be met with apathy. I'd like to code it myself, but I
don't have Linux on my PC, or a broadband connection, or much free hard
drive space, or... time. So there you have it: my two cents, backed up by
hot air.
-- Tim Starling.
_________________________________________________________________
Hotmail now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_mobile.asp