...Expose a small set of simple types. Map server logic into a simple function: a single argument for the request, the response is the return value. Trivially mix and match synchronous and asynchronous processing. Flexibility to return a simple string or a byte stream with the same model. An adapter must handle all errors from the handler, including the handler returning a null response. It should print each error to the console if possible, then act as though the handler returned a 500 response. The adapter may include body data for the 500 response, but this body data must not include information about the error that occurred. ...
mod_setenvifplus is module for the Apache Web server which allows you to set environment variables and request/response headers according to whether different aspects of the request match regular expressions you specify.
...These can be used in the logic of the site on the server side.
When a request is received, it looks at the User Agent String of the incoming header and matches it against the database. If there is a match, the device capabilities are stored as PHP and Javascript variables for you to use in shaping how your site is served out.
If there is no match, the request is re-directed to a javascript 'learning page' where the database is updated with the client capabilities and is redirected back. This happens in a flash.
The 'learning page' uses Javascript and Modernizr. ...