Mobile Browser Cache Sizes – Round 2

Just over a year ago I posted the results of my research about Mobile Browser cache sizes. At the time, there was general consensus mobile browser cache was small, but a lack of concrete numbers to support it. I created some cookie-based measurement tool, which helped confirm mobile browser cache sizes were indeed far smaller than desktop browsers.

A lot has changed since then. Google shipped Chrome for Android, which explicitly stated it addressed the small cache size. Android’s native browser has also improved dramatically, as did Apple’s Mobile Safari. In addition, Firefox released an Android browser, and both Google and Yahoo released hybrid browsers for iOS (Chrome for iOS and Yahoo Axis), which mix Apple’s UIWebView with some of their own software.

With all those changes, plus some probing from Steve Souders, I figured it’s about time to rerun my tests.

Summary Table

Starting from the bottom line, here is a summary table of the max cache sizes per browser and OS, including the new and old results.

OS Browser Max Persistent Cache Size
iOS 4.3 Mobile Safari 0
iOS 5.1.1 Mobile Safari 0
iOS 5.1.1 Chrome for IOS 200 MB+
Android 2.2 Android Browser 4 MB
Android 2.3 Android Browser 4 MB
Android 3.0 Android Browser 20 MB
Android 4.0 – 4.1 Chrome for Android 85 MB
Android 4.0 – 4.1 Android Browser 85 MB
Android 4.1 Firefox Beta 75 MB
Blackberry OS 6 Browser 25 MB
Blackberry OS 7 Browser 85 MB

Note that the tested Android devices and OS versions were: Samsung Galaxy S (2.2), Google Nexus S (2.3), Motorola XOOM (3.0), Samsung Galaxy S 3 (4.0), Google Nexus 7 (4.1), Google Nexus S (4.1).

As you can see, with the exception of Mobile Safari, cache sizes seem to have grown significantly over the last year. Now on to the details…

Persistent vs Memory Cache

In last year’s tests I attempted to measure both persistent cache and memory cache. Persistent cache meant cache that lives through a restart of the browser process or a power cycle of the device. Memory cache, in contrast, only lives while the browser process lives, and often shrinks if the system requires more memory.

Memory cache proved – then and today – to be extremely unpredictable. Repeated tests showed dramatically different results, with one test often implying a cache size 2-3 times bigger than the other’s. Regardless of whether memory cache is indeed this volatile, or the methodology (explained below) doesn’t measure it well, there’s no point posting these numbers.

For those reasons I decided not to post memory cache sizes this time. Suffice to say I’ve seen cases where memory cache held more than 100 MB of data, and cases where it held less than 10, on the same device. Beyond that, this year’s numbers reflect persistent cache sizes only.

Android Results

For Android, the new “magic number” for a max cache size seems to be 85 MB. This number is used by Chrome for Android on tablets and phones, and in Android’s default browser on both Ice Cream Sandwich and Jelly Bean phones.

It’s worth noting that Tony Gentilcore stated Chrome for Android calculates its cache size based on available disk space, and Matt Welsh mentioned in his Velocity 2012 presentation (Slide #47) Chrome for Android has a cache of 250 MB, though he didn’t state if that was memory or persistent cache.

So while my measurements consistently showed 85 MB of cached data for Chrome (on multiple devices), it’s possible it could go higher.

iOS Results

The biggest disappointment was Mobile Safari. Unchanged from last year’s tests, Mobile Safari has no persistent cache whatsoever. Whenever browser is restarted or the device power-cycled, all browser cache is cleared.

In fact, in iOS 5.1 Apple has even made localStorage non-persistent for apps that use UIWebView (an embedded browser), going against W3C’s guidelines.

However, hope is not lost for iPhone users. In my tests, Chrome for iOS maintained a persistent cache of 200 MB (!!!). It’s possible the cache was even larger, I stopped the test at 200 MB. On a different iOS device, I could never get Chrome to cache more than 35 MB, strengthening the theory that it determines its limits based on available disk space.

To confirm this isn’t just a feature of UIWevView, I tested Yahoo’s Axis pseudo-browser and Twitter’s embedded browser. Both had any persistent cache, making me believe Google wrote some custom code to handle caching – not surprising considering they handle the networking in that browser as well.

Clearly caching is feasible on iOS devices, and it’s possible better caching is one of the reasons many users feel Chrome is faster than Mobile Safari. Hopefully Apple learns from this and bumps up its native browser’s cache.

Other Browsers Results

I also tested two additional browsers – Firefox on Android and the browser Blackberry 9900 (OS 7).

Firefox (Beta) for Android held a 75 MB persistent cache. However, various conversations I’ve had and past browser hacks showed Firefox has a more complicated cache than most. For example, some prefetching techniques showed it holds images and scripts in separate caches. If those caches don’t share a quota, it’s possible the max cache size is bigger.

On Blackberry, the 85 MB magic number surfaced again. This is an improvement from the 25 MB cache on OS 6. That said, it’s not necessarily the future, since Blackberry is now focusing on QNX as their main platform, with a completely new browser.

I did try to test the Playbook’s browser, but my tests indicated it has no memory cache at all. This seems extremely unlikely to me, and it’s easier for me to believe my testing techniques just doesn’t work well on that browser.

Methodology

The detailed methodology is the same one I used in my tests last year. In a nutshell, it primes the cache by loading a sequence of pages (each page loads the next one). Each page holds 4 scripts weighing 256 KB each. All the scripts are cacheable, and the HTTP response of the script sets a unique value to the cookie “A”.

Once the cache is primed, the pages load each other in reverse order, and compare the value of “A” at the beginning and end of the page load. If the resources are loaded from cache, nothing changes the cookie value and it remains the same. If at least one of the resources is fetched over the network, the cookie value changes, marking the end of the cache (with a resolution of 1 MB).

Summary

Mobile browsers evolve quickly, and most seem to have heard the complaints from the web performance community. The average  mobile browser cache size has definitely increased, and hopefully will get even bigger with time. The clear winner is Chrome for iOS, which surprisingly demonstrated a bigger cache than Chrome for Android.

Except for Chrome for iOS, browser cache is still small on mobile compared to desktop.  Desktop browsers claim disk cache sizes such as 250 MB for IE 9, 200 MB for Chrome (based on chrome://net-internals#httpCache) and 540 MB for Firefox (based on about:cache). At least Chrome, and perhaps others, calculate max cache size based on available disk space on both Mobile and desktop, which may account for this gap.

There’s definitely reason to be optimistic about mobile browser cache given these improvements, but we can’t let off mobile browser vendors just yet. I’ll be happy when all mobile browsers match Chrome for iOS for cache size, and think we may just get there after all.

Posted on August 28th, 2012
  • Matt

    Do you know of any similar research around HTML5 application cache sizes?

    • Guypo

      I believe most browsers support up to 5 MB for appCache, per top level domain, similar to the localStorage size limit. I haven’t done any testing myself, but I’ve seen that number used quite broadly.

  • http://twitter.com/tutatis Matías Attwell

    Great post, as usual Guy. What about Opera Mini? The’ve got a fair share of mobile browsing: 20% globally.

    • Guypo

      I’m afraid not. Opera Mini works in a very different manner, since it actually processes the page remotely and communicates it down. This means my test wouldn’t work on it, and in fact I’m not even sure if I understand how would browser caching work in Opera Mini, if it’ll work at all…

      • http://people.opera.com/danield Daniel Davis

        I agree that Opera Mini’s server-side rendering makes it not possible to test, but it would be helpful to see Opera Mobile (Android) included in your comparison. I work for Opera and can help with resources if necessary.

        • Guypo

          You’re right that I should have included it in the tests, I am also missing Windows Mobile, simply because I don’t have a device available at the moment…

          I just installed Opera on a Nexus 7 Tablet and ran the tests, and Opera demonstrated a persistent cache size of at least 200 MB (!!!). This is impressive, similar to Chrome for iOS. I tested it twice, and got the same results, though I didn’t try to power-cycle it (which I did with some of the other tests).

          Since you work for Opera, does that sound right to you?

  • http://twitter.com/benfrain Ben Frain

    Great info Guy, thanks for sharing.

  • Frédéric Kayser

    To you know if what’s kept in the cache is based on the file type or not, if there are individual file sizes limits, and if some sort of ranking based on the number of views is used to keep the most used files in the cache?
    For instance if I browse once to a picture gallery and take a look to some hires pictures could they gobble the cache and take the place of something like 40 .css files even thoose from sites I check daily?

    • Guypo

      I don’t have any data there, but my understanding is that as of today, most browsers have a very simplistic cache eviction policy, almost entirely based on “Least Recently Used”. There’s some indication Firefox caches files separately by type, but I think the total cache size is still shared between them.

      Would be an interesting test to do, I’ll add it to the (overly long) list :)

  • WanyBae

    Nice article. Thanks for sharing.

  • http://www.facebook.com/milosgacanovic Milos Gacanovic

    Great article.
    But, what about IOS 6 Mobile Safari? Is it the same as in 5.1.1?

    • Guypo

      Anecdotal checks show it’s the same for iOS 6, though I didn’t run as comprehensive a test on that OS version.