Server Side Adaptation
Server side adaptation comes in various forms. At its simplest, it relates to using scripting to vary small parts of the page delivery. One example is changing the HTTP Content-Type header attached to the content. As previously discussed, it's not typical to use the content type text/html when delivering to mobile devices. On the other hand, when delivering such pages to some versions of Internet Explorer on the desktop, it can be more effective to use that content type. In this example, the adaptation would consist of a test to see which User Agent (browser) accesses the page and deliver the chosen header based on whether the browser is Internet Explorer or not.
The following is a simple (and incomplete) example of how to do this in the server side scripting language PHP:
<?php $msie = strpos($_SERVER["HTTP_USER_AGENT"],'MSIE') > 0; if (!$msie) { header("Content-Type: application/xhtml+xml; charset=UTF-8");} else { header("Content-Type: text/html; charset=UTF-8");} ?>
Other examples of varying the content to better suit device characteristics include presenting an appropriately sized image for the device accessing the page. A good general guidance for low-end devices is to limit images to 120px width. Those with high-end devices will have a much better experience if the image fits their screen and its color depth.
Because it wastes bandwidth to transfer images that are bigger than the screen can handle, it's good practice to resize images at the server prior to transmission.
Do this by preparing specifically sized images in advance and choosing the biggest size that will fit; or dynamically resize the image at the point of delivery.
Both approaches have advantages: The former is better when the image must preserve specific details (e.g. the ball in a sports photo). The advantage of dynamic resizing is its ability to fit an image exactly to the device.



Sign in or register to reply.