tech.agilitynerd.com

scratching that itch... 
Filed under

referrer

 

Debug Site for Website Redirects By Referer String

I'm adding an "m" subdomain to agilitycourses.com to provide a better mobile browsing experience. I'm using the referrer string in Django middleware (currently using minidetector) to detect whether the client is mobile and redirect them to the mobile site. Since it is likely that some folks will/won't get appropriately redirected I was looking for an easy way for them to tell me when they were incorrectly redirected. I'd need to know their referer string.

A little googling turned up a nice one purpose website: www.whatismyreferrer.com/

Filed under  //   django   mobile   referrer   web development  

Comments [0]

Refererblock Version 0.2

I came up with two improvements to the first release of my refererblock plugin:

  • If the referer string matches the site's URL it passed immediately and isn't checked against the blacklist.
  • The blacklist.txt file was being read even if the referer string was empty. Now it is only read if the referer string is not empty and it isn't for the site's URL.

These optimizations do improve the performance of the plugin. My testing on a PIII 800MHz running Fedora Core 3 Linux with Apache 2.0 showed the following average latencies:

  • 1.5 ms - Empty referer string or current domain.
  • 2.0 ms - Referer string matching the first regex of the example blacklist file.
  • 3.0 ms - Referer string matching the final regex of the example blacklist file.

I was kind of surprised at how little additional time was required to load the blacklist file and process the regular expressions. This is probably due to the file remaining in the disk cache for subsequent requests. Of course your mileage may vary.

Download version 0.2 of the plugin here.

See my original plugin description for installation, configuration, and testing information. Please let me know if you use this plugin or if you have comments or suggestions for improving it.

Filed under  //   blosxom   plugin   referrer   spam  

Comments [0]