One of the things that makes Opera Mini the world's most popular mobile browser is its ability to compress data. Of course, you know that it saves you time and money - but do you know how data compression really works?
As much as we'd like to think it's all done with a wave of a magic software wand, it turns out that data compression is not one single action so much as a set of processes that preps content from the web and makes it faster and easier to consume on your phone.
Martin Nilsson, Solution Architect for Opera Mini, explains how Opera Mini is able to serve up so much internet tastiness.
Martin, when did the idea for data compression in Opera Mini first come about?
The first project Opera worked on that involved compression of mobile data was the Opera Mobile Accelerator (editorial note: launched in 2004, this was a subscription-based service that cost EUR 12 for 3 months of service!). That project was discontinued and we started working on Opera Mini instead. The idea with Opera Mini was to make a browser for (at the time) browserless phones.
How does Opera Mini work today?
Unlike ordinary web browsers, Opera Mini fetches all content through a proxy server that reformats web pages into a format more suitable for small screens. A page is compressed, then delivered to the phone in a markup language called OBML (Opera Binary Markup Language). This compression process makes transfer time about two to three times faster and the pre-processing also increases compatibility with web pages not designed for mobile phones.
What do the servers do in terms of reformatting?
Mobile devices differ in many ways to desktop devices. Given the smaller screen size, different text handling may be used to improve readability. Also between mobile devices there are those with only numeric keyboard, those with QWERTY keyboard, with D-pad, stylus, touch etc. Many things that work on desktop don't work on mobile, especially when there is no mouse pointer to scroll frames or do mouseover actions. To solve these many small usability issues, tweaks need to be made.
What happens when the data gets compressed?
First of all, and this is very important, data compression doesn't actually help very much in terms of speed. What matters is the latency, the time from the user action until the first response is seen. Some of the primary methods for reducing latency include:
- Our own client-server protocol that keeps a connection established for sending requests. There is a 20-30% end user benefit in terms of latency.
- Since we use a single-request - single-response protocol we minimize the usage of the high latency radio network and instead fetch all the inlines, stylesheets etc. from our fast servers.
- We connect directly to some content partners like Facebook and Google, and even have other companies' web servers in our server rooms so that the latency from our transcoders relative to the volume of content is as small as possible.
There are also several different types of compression and data reduction used in Opera Mini.
- The servers keep information about the clients, so this information only needs to be sent from the client to the server once, instead of in every request.
- Cookies are managed entirely on the server side, so that data never have to go back and forth at all.
- Images are scaled to better fit the display size of the device to make them as size efficient as possible while making the resulting web page as good looking as the end user quality settings permit.
Finally, the resulting data is compressed in different ways. Normally we send text first, followed by links, essential layout elements and finally all graphics. We focus also on sending data where the user will start reading before other parts of the page.
Given that all the data has to pass through Opera's servers, what about security issues?
Opera Mini is like a desktop computer. The browser sits in the computer while the user looks at the screen. In Opera Mini the browser sits on our servers while the user is looking at the page in their handset. We know that the success of Opera Mini depends on us being able to run the servers securely. So far we have not had any incidents.
Are Opera Mini servers all in Norway?
There are some in Norway, but we have servers at multiple locations, where it makes sense from an economic and performance perspective. One example is our Iceland data center, which sits right between US and Europe, and benefits from geothermal energy.