1 | 2

1 - 5   [9]

Harmonising Link Prefetching And Logging

Relates to PHP and Apache, Firefox and Co

As part of my ongoing redevelopment of this website and in particular my weblog itself I have been building a set of classes to provide visitor statistics. The objective is a simple lightweight solution to summarise referrers, page counts, countries and other similar information per request and without the overhead of trawling the Combined Log Format. With PEAR_DB providing the database abstraction, storing the data is a simple case of compacting all the informative variables and running an auto-execution statement. Of course on the first test drive in Firefox, doubling up of log entries reared its head. This is due to the use of the <link rel="next" href="" title=""/> element providing accessible navigation to the next entry. All the Mozilla browsers (since the days of Netscape 7.x and Mozilla 1.2) will send an HTTP request for the URI in the href attribute to improve performance, thus appending an additional, yet misleading, log entry.

Fortunately there is a simple solution to this which can be resolved in the PHP routine. The browser sends a custom header to tell the server that this is a prefetch request:

X-Moz: prefetch

So in the PHP routine, prefetched pages can be excluded with the following conditional:


if (isset($_SERVER["HTTP_X_MOZ"]) &&
    $_SERVER["HTTP_X_MOZ"] == "prefetch") {
  // do not log the request
  return false;      
}
else {
  // log the request
}

This discovery, all thanks to Live HTTP Headers has been a great salvation to me, since the double logging had caused me many headaches in the past. Accurate logs are essential for good SEO and providing valuable and relevant future content to visitors. But with the current growth in Mozilla based browsers (Firefox in particular) I have found logs becoming more and more distorted. Neither removing relative links nor resorting to Internet Exploder are desirable solutions.

Information on Link Prefetching seems to be sparse but here are the main pages from Mozilla:

Unfortunately this solution does not resolve the general quibble I had with overstated logs and Webalizer. The last release of Webalizer actually preceded the introduction of the prefetch HTTP header. This is a hugely popular log analyzer that seems to be present across a wide range of web servers and hosting packages - makes me wonder how many people are optimistically interpreting over-stated logs? I suppose, with accessibility still on a gradual advance to the mainstream, and the use of the link element only appearing on progressive and forward thinking sites, probably not actually that many.

I have currently been test driving an excellent and very detailed alternative log file analyzer called AW Stats. Well worth a test drive.

Posted on Jul 12, 2004 at 02:33:14. [Comments for Harmonising Link Prefetching And Logging- 1]

Experiments With DHTML Tooltips

Relates to CSS Design and DOM Scripting

Just been having a little play with alpha transparencies and event handling for customised tool tips using DHTML and CSS. Just another reason why Internet Exploder should be laid to rest!

So, here is the first run at accessible DHTML transparency tool tips. There is more to develop to make this accessible to the widest possible audience, so will hopefully come back to it at the turn of the tide

Posted on Jul 11, 2004 at 05:29:06. [Comments for Experiments With DHTML Tooltips- 0]

One Year, One Weblog Later

Relates to SEO and Peregrinations

June 2003 Web Server Logs

Total Pages
292
Total Visits
125

June 2004 Web Server Logs

Total Pages
7664
Total Visits
4442

(Logs for www.severnsolutions.co.uk and its subdirectories. Un-adjusted for searchbots.)

Incontrovertible evidence for Standards Based development leading to improved SEO and accessibility. Oh, and the expansive presence generated by a pseudo-weblog archive system.

Posted on Jul 10, 2004 at 17:56:20. [Comments for One Year, One Weblog Later- 0]

Webmail Management Bookmarklet

Relates to DOM Scripting and Peregrinations

The age old problem - spam! While I patiently wait for that elusive Gmail invite, I am still running a couple of old webmail accounts that have been active for several years. I would be content to disable them except for the occassional critical email I receive. So once every 5 or 10 days I will log into the accounts and spend the best part of half an hour selecting and deleting anywhere from 1000 to 2000 spam emails just to find those few important messages. Fortunately the Inbox can display 1000 messages on a page and, accompanied by the select all button, this speeds up the process slightly, but I still have to deselect all the archived messages. This seemed like the perfect opportunity to write a boomarklet to speed things up a bit.

Of course this bookmarklet is proprietary with the DOM navigation specific (and quite cumbersome!) to the layout of my Webmail Inbox, but perhaps you may find it useful for editing to your requirements?


javascript:(
 function(){
  var a = confirm(%22Do you wish to select?%22);
  var rn = prompt(%22Enter range of cells to %22 + 
                 ((a) ? %22select%22 : %22deselect%22)); 
  var r = rn.split('-'); 
  var rows = window.frames[3].document. _
             getElementsByTagName('table'). _
             item(0).getElementsByTagName('tr'); 
  var min = parseInt(r[0]) + 2, max; 
  max = (r.length == 1) ? rows.length : parseInt(r[1]) + 3; 
  for (i = min; i < max; i++) {
   rows.item(i).getElementsByTagName(%22a%22).item(0). _
    nextSibling.checked = a;
  }
 }
)();

Note, the _ character is just a line continuation. Has made my webmail routine that bit easier, more efficient and fulfilling :)

Posted on Jul 10, 2004 at 17:42:59. [Comments for Webmail Management Bookmarklet- 0]

Live HTTP Headers Updated

Relates to Firefox and Co

Excellent! Live HTTP Headers is the penultimate extension update I have waited for to remove Firefox 0.8 from my desktop. A fantastic developer extension I simply can't do without when creating server side applications. The latest version has some great improvements including the ability to apply exclusion filters with regular expressions and to attach the panel to the sidebar to track headers with maximised windows.

Now I hold on for an update to the Link Toolbar, another essential tool I utilise to validate the dynamic generation of next and previous links without having to view the source.

The new extension manager, which has worked seamlessly on my Windows 98 platform, has swayed me into downloading and sampling considerably more extensions than when I was managing multiple user profiles to protect against compatibility issues. Tabbrowser Extensions was recently updated so I have can reclaim tab session memory management. I also find the Cookie Culler and Flat Bookmark Editing to be useful additions to the feature set. And lastly, for now, Jed Brown's BB Code extension is convenient for heavy forum posting - especially the clipboard features.

Posted on Jul 10, 2004 at 17:38:55. [Comments for Live HTTP Headers Updated- 0]

Breadcrumbs Trail

[ Home ] -> TW Blog -> Archives for July 2004
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.007 seconds