Trackback and XmlHttpRequest
Monday, 24 January 2005
A couple of days ago I enabled Trackbacks on this weblog. Nucleus does not support this out of the box, but thanks the NP_Trackback plugin you can easily add this functionality. The plugin is easy to install and work pretty good. I did notice some things that could be improved, most notable the Trackback auto-discovery.
Auto-discovery is actually pretty simple. If you use a link to a page on another weblog, the plugin will visit that page and look through the HTML source code in an attempt to find a small snippet of RDF code. The RDF snippet contains the Trackback URL which the plugin uses to post the Trackback. Auto-discovery saves some time because previously you had to manually look for the Trackback URL.
Auto-discovery also had a big drawback. Everytime you try to edit an entry, the plugin would go through the links and try to discover the Trackback URLs.
Update: Thing are getting pretty stable, so I’ve uploaded a test version. Try it out, but don’t blame me if your server catches fire.
In addition to this big change, I’ve also made some smaller refinements. For example, auto-discovery will no longer try to detect a Trackback URL for every link in your story. Before retrieving the contents of the link it will first sent out a HEAD request to determine whether or not the link points to a HTML page or not. It’s is pretty useless, and more importantly, very time consuming to try to detect Trackbacks in non-HTML links, such as MP3 files or large pictures.
A second small refinement is caching of the auto-detected Trackback URLs. Currently, every time an item is edited on your site, the Trackbacks redetected. I’ve added a new database table which will hold the auto-detected Trackback URLs, so once a link has been processed by the auto-detection routines it will no longer need to contact the page to which the link points. This should result in a speed-up for editing existing stories.