Speeding Up Mobile Applications

Mobile Application Design and Development [./]
Spring 2010 — INFO 152 (CCN 42504)

Erik Wilde, UC Berkeley School of Information
2010-04-16

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents Erik Wilde: Speeding Up Mobile Applications

Contents

Erik Wilde: Speeding Up Mobile Applications

(2) Abstract

In order to speed up mobile applications, the optimization of network traffic often is one of the areas where significant improvements can be achieved. Since most network traffic uses HTTP, it is important to understand how HTTP caching works, and how servers can be configured to make caching work more effectively. However, since servers have no control over the clients and possible HTTP intermediaries, it is also important to understand the general architecture of HTTP caching, and how applications may or may not have good caching support on the platform they are built on.



Server-Side Performance Analysis

Outline (Server-Side Performance Analysis)

  1. Server-Side Performance Analysis [5]
  2. HTTP Caching [7]
  3. Client Caching [3]
  4. Server Configuration for Caching [5]
Server-Side Performance Analysis Erik Wilde: Speeding Up Mobile Applications

(4) Server Logs

server-log.png

Server-Side Performance Analysis Erik Wilde: Speeding Up Mobile Applications

(5) Connecting to the Server

putty.png

Server-Side Performance Analysis Erik Wilde: Speeding Up Mobile Applications

(6) Log File Display



Server-Side Performance Analysis Erik Wilde: Speeding Up Mobile Applications

(7) MobApps Server Logs

server-log-mobapps.png

Server-Side Performance Analysis Erik Wilde: Speeding Up Mobile Applications

(8) Server Log Analysis

log-analysis.png

HTTP Caching

Outline (HTTP Caching)

  1. Server-Side Performance Analysis [5]
  2. HTTP Caching [7]
  3. Client Caching [3]
  4. Server Configuration for Caching [5]
HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(10) Resource Orientation



HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(11) Cache Locations



HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(12) Caching in the Platform

flickr-web.png

HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(13) HTTP Metadata

GET /4026/4519445803_06922b9171_b.jpg HTTP/1.1
Host: farm5.static.flickr.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-us,en;q=0.7,de-de;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://www.flickr.com/photos/dret/4519445803/sizes/l/

HTTP/1.1 200 OK
Date: Fri, 16 Apr 2010 17:02:20 GMT
Content-Type: image/jpeg
Connection: keep-alive
Server: Apache/2.0.52 (Red Hat)
Cache-Control: max-age=315360000
Expires: Mon, 28 Jul 2014 23:30:00 GMT
Last-Modified: Wed, 14 Apr 2010 04:57:32 GMT
Accept-Ranges: bytes
Content-Length: 361084
X-Cache: MISS from photocache510.flickr.gq1.yahoo.com
X-Cache-Lookup: MISS from photocache510.flickr.gq1.yahoo.com:81
Via: 1.1 photocache510.flickr.gq1.yahoo.com:81 (squid/2.7.STABLE6)
[http://www.flickr.com/photos/dret/4519445803/sizes/l/]

HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(14) Caching in the Application

flickr-iphone.jpg

HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(15) Caching in the Cloud

Opera Mini and Opera Turbo

HTTP Caching Erik Wilde: Speeding Up Mobile Applications

(16) Cache-Friendly Services



Client Caching

Outline (Client Caching)

  1. Server-Side Performance Analysis [5]
  2. HTTP Caching [7]
  3. Client Caching [3]
  4. Server Configuration for Caching [5]
Client Caching Erik Wilde: Speeding Up Mobile Applications

(18) Caching Conformance



Client Caching Erik Wilde: Speeding Up Mobile Applications

(19) Mobile Safari Caching



Client Caching Erik Wilde: Speeding Up Mobile Applications

(20) Native Application Caching



Server Configuration for Caching

Outline (Server Configuration for Caching)

  1. Server-Side Performance Analysis [5]
  2. HTTP Caching [7]
  3. Client Caching [3]
  4. Server Configuration for Caching [5]
Server Configuration for Caching Erik Wilde: Speeding Up Mobile Applications

(22) More Metadata is Better



Server Configuration for Caching Erik Wilde: Speeding Up Mobile Applications

(23) Freshness of Responses



Server Configuration for Caching Erik Wilde: Speeding Up Mobile Applications

(24) Configuration Steps



Server Configuration for Caching Erik Wilde: Speeding Up Mobile Applications

(25) Entity Tags (Etags)



Server Configuration for Caching Erik Wilde: Speeding Up Mobile Applications

(26) The Problem with ETags



2010-04-16 Mobile Application Design and Development [./]
Spring 2010 — INFO 152 (CCN 42504)