Tuesday, March 18

Geek

Wrong Button!

Oh, yeah.

The reason the performance issue came up was that I was testing one of the three** methods for sharing posts between blogs.  The three being cross-posting (post one entry on two blogs), folder peering (set an entire folder - a category, for example - to appear on two blogs), and direct template hackery.

The last is what I was testing.  It works, but with a catch.  The old template relied on standard site and folder data to construct the URLs for the permalink and comments pages (which are the same by default, but need not be).  That's okay for cross-posting and  peering, because the post really is on your site, either at the thread or folder level. 

When you engage in template hackery, though, you are calling up posts entirely ad-hoc from another blog (assuming said blog has set access rights to allow you to do so).  If we rely on your site data to generate links for posts that only exist on the other site, then those links don't work.

The solution to that is simple - join the folder and site tables in the query and add their public fields to the dataset for the post tag, and modify the templates to use those new fields to construct the links.*  But that means a slightly slower query and a little more processing for the tag engine for every page, because while I actually could make the template auto-sense cross-site ad-hockery, it's too much trouble and would scramble the brains of any poor user who just wants to tweak their layout a little.

And so, millisecond by millisecond, performance decreases, and CPUs aren't getting faster at the same rate anymore.  The road to Hell is paved not with good intentions, but with "minor" code changes.

* This now works, by the way, though you do need to use the (absolute) post.url tag instead of the (relative) post.path in your templates.  Um, once 1.2 is released, that is.

** Four.  You can also view friends' and friends-of-friends' posts using template hackery.

*** Five!  I just realised that it's dead easy to allow smart folders to work across sites.  (Smart folders are much like smart playlists in iTunes - they automatically collect posts from other folders based on whatever search criteria you specify.)  The only real work left is setting up the access control.

Posted by: Pixy Misa at 01:40 AM | Comments (2) | Add Comment | Trackbacks (Suck)
Post contains 397 words, total size 2 kb.

1 Is there a way to check our reffererererer logs in meenu? I got a visit from Danny Choo in my comments and I have no earthly idea how he would have got to my site.

Posted by: Will at Friday, March 21 2008 11:18 AM (WnBa/)

2 Sorry, not yet.  Referrer tracking is something I'm hoping to get into the 1.2 release...  Which does you no good in this case.

Posted by: Pixy Misa at Friday, March 21 2008 04:37 PM (PiXy!)

Hide Comments | Add Comment

Comments are disabled. Post is locked.
47kb generated in CPU 0.0218, elapsed 0.3678 seconds.
56 queries taking 0.3544 seconds, 328 records returned.
Powered by Minx 1.1.6c-pink.