Multiserving is a general term which basically mean to serve content in a different format depending on the characteristics of the device requesting it.
By means of the detection engine MWT performs a layered multiserving:
MWT features an adaptation engine that is in charge of manipulating the content before it gets served, in order to provide a best fit to the characteristics of the requesting device.
For what concerns adaptation the main problem is related to the different screen sizes of mobile devices. While the difference in screen height isn't normally an issue (mobile sites like ordinary web sites can be scrolled up and down and pages can be extended up to a few times the physical height of the screen), it is very important to appropriately rescale the content with respect to the screen width in order to obtain a suitable rendering.
MWT solves this problem by automatically rescaling the images whose width exceeds the screen size and by providing special tags and macro to control the width and the rescaling of XHTML elements.
Image rescaling in MWT is done by means of an internal Image Server (despite its name it is just a PHP class).
MWT parser processes the XHTML document and calls the Image Server when it encounters a IMG tag. The Image Server classifies images with respect to their with: there exists several type of image classes, each class with its corresponding width. In the processing phase, the class width that better represents the current device is taken into account, if the width of the processed image exceeds the current width it is properly rescaled and put in a spool directory for caching. The SRC attribute of the processed IMG tag is accordingly changed to point to image in the cache, in this way the rescaled image is served in place of the original one.
Thanks to image caching, rescaling is done only once for each image and class width. The image classification reduces enormously the number of images created by the Image Server and makes it possible to pre-ingest rescaled images so that they are automatically found in the cache directory by the Image Server.
The Image Server can handle also external images: when the value of the SRC attribute points to an external URL, the image is first downloaded and then rescaled.
For image rescaling the Image Server can be configured to use PHP image manipulation support (available when PHP is compiled with GD library) or Image Magick (faster).
MWT provides some special tags that enable you to control the behaviour of the Image Server on a per-image basis or for all IMG tags in a XHTML block: these tags let you force rescaling to a specific width/height or can be used to enclose expressions that retrieve CMS content so that it gets automatically resized.