I recently had an interesting conversation around device detection and decided
to share it with the list. I categorize device detection into the following:
-Backend device detection and request routing
Looking at the HTTP User-Agent field allows requests to be accurately
routed to device specific sites (or services or resources). This gives you a
lot of design flexibility. You can go ahead and target a given site to devices
where it's most appropriate and not have to worry about how to make that design
work across a wider array of devices. This has many performance benefits, both
backend, network, and frontend.
-Client side feature detection
This represents the other side of the device detection spectrum. What
is important here is that you detect the presence (or lack of) features and not
the devices themselves. This is done very differently than backend device
detection and is usually accomplished with CSS and Javascript. Feature
detection on the client side will provide for a much more responsive design
across devices than device detection.
-Client side device detection
I found client side device detection only helpful in limited scenarios
like metrics, ad targeting, and client side analytics. Client side device
detection can be done by exposing backend device detection as a JSON service
and having the browser make a call to the service.
I found the most value in combining backend device detection routing with
client side feature detection. This allows sites and services to be designed
with specific device classes in mind (feature phones, smart phones, tablets,
desktop browsers) which allows for the reduction of responsiveness complexity
and a design which is more native to the target device. The key here is to be
flexible. Purely responsive designs and purely device detected designs are not
flexible enough to meet all performance and design demands.
I recently open sourced our backend device detection framework which uses
OpenDDR and provides backend integration:
https://github.com/TheWeatherChannel/dClass. dClass is used for backend device
routing and for client side device detection service (both in Varnish).
Reza Naghibi