Thursday, November 16, 2006

User Agent Capabilities HTTP Service

When I first (1 year ago) got eXist [1] Native XML database and imported a plain un-fallback-ed WURFL [2] xml file I got a 200MB file that my eXist database was querying in my notebook (By that time Intel Pentium 3, 1 GB RAM) in about 0.02 sec just to give for example all the capabilities for a particular User Agent.

Several times I have been posting this idea in the wmlprogramming yahoo mailing list.

Currently I do not need WURFL other than to check my propietary database is good enough or not. In fact my Company needs some people involved in checking those capabilities in a daily basis. I am in charge of other tasks and cannot dedicate time to this idea if I do not find a sponsor. But the idea is actually pretty straightforward:

1)Get the WURFL file and you make a plain one without fallback.
2)Host the file in eXist Database.
3)Design the Queries you need (XQuery to get results, XUpdate to update data or insert new handsets).
4)No need for aditional development ... eXist has all you need GET/POST/REST/XML-RPC/SOAP and you use simple HTTP calls to request your capabilities.
5)Adding value:
A. To update your database you should periodically check wurfl with HEAD (not sure if it is working from the server it is hosted but it is a good idea to have that implemented). Recently someone was asking for an automatic way of checking updates to WURFL. Use HEAD HTTP Request for it!
B. When a new handset comes do not forget to get the UAProf from HTTP headers. Try to parse it automatically, try to discover any discrepancies and log the results. It will help people that are in charge of maintaining WURFL.

At the end of the row you end with a non language related service that your company can use to give the capabilities of a given UserAgent to all the implementations you have in C#, Python, Perl, Java, RoR etc.

Of course it would be ideal to have this as Open Source and one of the ideas I have been trying to sell is that a Company could host a service like this and provide free service based on IPs for some requests. If a portal has many visitors and a developer needs more throughput a fee could be charged. On the other hand the XQueries, XUpdates remain Open Source just in case someone wants to host his/her local copy of the XML database.


No comments: