AlfaProject has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks :) I want to start developting mobile web aplication. I found 2 ways to recognize the mobile device and resize images.
They both are using WURFL database
One type is apache2 mobile filter , module for apache. It's contain few parts. For recognizing devices , for resizing images , for switching (with location headers) to mobile site or regular web site and others handy features.
The second is perl module that can put WURFL database to MYSQL database and search devices using device useragent. The resizing images part I can write within perl , it's not the problem.
I just want to understand , what advantages each way have.
I mean apache-module vs perl-module?
Thanks a lot
  • Comment on apache2 mobile::filter vs mobile::wurfl

Replies are listed 'Best First'.
Re: apache2 mobile::filter vs mobile::wurfl
by chrestomanci (Priest) on May 29, 2011 at 20:44 UTC

    I was recently working on a project that involved WURFL device detection. I would say that your choice depends on what you are trying to do.

    Once WURFL recognizes a device, you get access to a huge database of device properties. Not just the screen size and supported image types that you would need for image resizing, but everything from how the user can scroll around a web page to the video codecs supported. In theory you could write a full adaptable web site that tailors many different features to match the capabilities of the device in use.

    apache2 mobile filter only scales images. You don't get access to anything else, so for example if a user visits your site with a small screen feature phone which does not support tables or CSS and does not have the connection speed or RAM to download a large and complex page then just changing the image size won't allow them to view your site.

    For what I was doing, I needed the extra information that you get from WURFL, as I needed to tailor my site more.

    One thing I did find with Mobile::WURFL, is that the device detection has no fuzzy string matching on the user agent string. I took a months worth of website logs, extracted all the unique user agent strings, and fed them into Mobile::WURFL. Only about half where matched. The rest where slightly different from something in the database, usually only a few characters different in something like a minor version number of the phone software. The Java and PHP APIs that WURFL project distributes uses Levenshtein based fuzzy matching, but Mobile::WURFL does not. I modified it to use Text::Levenshtein to do the fuzzy matching, but my boss would not allow me to send that patch back to the author of Mobile::WURFL.

      Thanks a lot for the answer!
      From what I know ,Apache mobile filter will pass inside %ENV all the additional info to perl ...
      But I decided not to use apache at all, so it doesn't matter.
      Also from what I see, Mobile::Wurfl and Mobile::WURFL are not so mature.
      I will take the ideas from the php api guys and write something from scratch...