aiScaler Mobile Client Caching Support
Posted by Max Robbins on October 25th, 2010aiCache uses the hostname and URL of request as a signature of cached responses. Some sites require different cacheable content in response to requests for the same URLs, depending on a value of a User Agent HTTP header present in the request. User Agent HTTP header identifies browser’s make and model.
A site serving mobile clients might serve responses whose formatting depends on exact mobile device/browser. To accommodate for such clients, while allowing for caching of responses, we must use User Agent information as part of cached response signature.
When a URL named “news.html” is accessed by 3 different mobile devices, we shall have 3 different responses cached – each containing mobile device’s User Agent string.
Using this feature has the potential to significantly increase the size of response cache (as multiple versions of same URLs are now cached). To solve this problem aiScaler provides:
Using reduced/rewritten User Agent string in signature of cacheable responses.
This feature is only available in mobile-enabled edition of aiScaler.
Related to the previous feature, this allows you to rewrite/reduce User-Agent strings to a smaller subset and use the rewritten/reduced values as part of cacheable response signature.
The problem this feature addresses has to do with a great variety of mobile devices currently available. Every firmware revision, different mobile providers/carriers/market all result in a different User-Agent strings sent by mobile device, making it a challenge to accommodate for all of these devices.
The great majority of mobile devices on the market can be reduced to about a dozen distinctly different devices (device families). So Blackberries can be grouped into may be 2 different sets, Iphones’s into its own set and so on, based on capabilities, support for Javascript and available screen sizes.
aiScaler allows you to accomplish just that. You specify rewrite rules for User-Agent strings. The rewritten/reduced User-Agent strings are then used as part of signature of cached responses.
The same “compressed” User-Agent string is also forwarded as X-UA-Rewrite header in requests sent to origin servers. The origin servers (server-side code) can then programmatically access and act on this header value, with a goal of modifying responses to accommodate for mobile device differences.
-For example resorting to Javascript-free versions of content for devices that don’t support Javascript, resizing the images to accommodate for different screen sizes.
The server-side code can also tailor the responses based on the actual value of User-Agent string (aiScaler never modifies it, it is forwarded verbatim from requesting device to the origin servers) – but then the server-side code has to accommodate for a much larger variety of devices.
Reducing the large number of different User-Agent strings to a much smaller subset also has a positive impact on caching of responses – allowing to achieve much higher cache hit ratios and to proportionally reduce the traffic and demands on origin server infrastructure (Web Servers, DB servers etc).
It also allows to greatly simplify the logic required to handle the variety of mobile devices available on the market today.
It is most desirable to accommodate for different mobile devices in a fashion that doesn’t require changing the URLs – so that no matter what mobile device is being used, News page is always accessed as /news.html, Sports section is always /sports.html.
The normal solution where URLs change, say by prefixing every URL with a device type, to accommodate for the device type is confusing to the customer.
aiScaler provides a manageable elegant solution to these issues.