Tag Archives:

WordPress

Cache

rennhund A little internal note: A few hours ago, I activated WP Super Cache, a plugin that caches the generated pages for some time – for the general audience even as pure HTML files so not even the PHP engine needs to start – thus reducing server load. Basically, you should notice no difference except that those pages that were accessed in the recent past are faster. Those who have written a comment (and got a cookie from that) won’t be served the “super cache” HTML.

The display of the recent comments in the sidebar may be not always up to date for non-commenters on cached pages, but I guess that’s not that much of a problem.

Moreover, DB Cache Reloaded has been running for the past few days, caching single database queries – which has the advantage that accessing other pages that have not been accessed recently also profit from this cache. However I noticed that the first access to admin pages and the first writing of a comment take a relatively long time – probably because DBCR then scans and flushes the numerous old cache files; seems this garbage collection isn’t that great yet…

Well, if you notice something wrong, please tell me. :)


Photo: TisseurDeToile/flickr, CC-Lizenz

Links of the Week (2008/51)

TwoSeven

M27 Oh well, the 2 and the 7… This on the right is M 27, the Dumbbell Nebula (image: ESO (Wikipedia)).

27 is a cubic number – and a pretty one at that, 3³. If you start at 0 when counting Pi’s digits, 27 is found at location 27 – apparently a rare case.

27 is (in base 10) the first composite number not evenly divisible by any of its digits.

On January 16, 27 B.C., the Roman Senate votes Octavian the title of Augustus. He accepts this honor, having declined the alternative title of Romulus. He is known as Augustus afterwards – the first Roman emperor.

And this blog, too, is now running WordPress 2.7. As usual: If you notice something that’s not working as expected, drop me a line, please.

High database load from Ajax Edit Comments…

… and a preliminary solution:

The WordPress plugin “Ajax Edit Comments” from The Reader Appreciation Project1 allows the commenter to edit his comment for a certain time – useful especially for typos and minor corrections. (Admins can do more.) Visitors utilize it here for about every 10th comment, by the way.

Now Pierre notified me yesterday about the high number of database queries (and that the response time could be better, too) – higher than what I always saw when logged in. (See the blue footer line.) Doing a little research, I found that it’s the aforementioned Ajax Edit Comments that uses 4 additional database queries for each comment in order to check if the visitor is allowed to edit it (unles (s)he’s logged in as admin who is always allowed to edit). That can sum up to quite a lot if there are many comments on a single post.

I quickly added a little modification to the plugin2 which check the comment age in advance without database access – in my quick tests, these modifications appear to work fine. If you too don’t see any problems – feel free to test it here or maybe later for the music quiz on 16:00 – I will, of course, send the changes to the plugin’s author, hoping they will be included in future versions. :)

  1. for WordPress 2.5 and higher – old version for 2.1–2.3.x here []
  2. in both the old version I’m still using here and the new in my test environment where I’m preparing the WordPress 2.7 update []