Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

20100918 android cache

8,760 views

Published on

  • Follow the link, new dating source: ❶❶❶ http://bit.ly/2F90ZZC ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ❤❤❤ http://bit.ly/2F90ZZC ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

20100918 android cache

  1. 1. Android HTTP Cache ( ) 2010-09-18 2010-10-03
  2. 2. Android HTTP • java.net • Java • HTTP HttpURLConnection • org.apache.http • Apache HttpClient 4.0 Android • HTTP • android.webkit • Android Android UI Web • HTTP Web 2010-10-03
  3. 3. (HTTP ) • Android HTTP (3G 300kbps 2000kbps) • → → → 2010-10-03
  4. 4. ( ) • • • ( ) • • →HTTP/1.1 Caching 2010-10-03
  5. 5. HTTP/1.1 Caching • RFC2616 • Web Web • HTTP/1.1 Caching HTTP 2010-10-03
  6. 6. HTTP/1.1 Caching • HTTP • If-Modified-Since • • If-None-Match • 2010-10-03
  7. 7. HTTP/1.1 Caching • HTTP • Expires • • Last-Modified • If-Modified-Since • ETag • If-None- Match 2010-10-03
  8. 8. HTTP/1.1 Caching • HTTP • Cache-Control • • Pragma • Proxy : no-cache 2010-10-03
  9. 9. HTTP/1.1 Caching • Apache lighthttpd Web • • ( 2010-10-03
  10. 10. HTTP/1.1 Caching • android.webkit HTTP/1.1 Caching • • →Apache HttpClient-Cache 2010-10-03
  11. 11. Apache HttpClient-Cache • Apache HttpClient 4.1 • HTTP/1.1 Caching • alpha (2010 9 ) 2010-10-03
  12. 12. Apache HttpClient-Cache • URL • http://hc.apache.org/ • Subversion URL • http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient-cache • jar http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/ svn get mvn package • Revision: 990924 (2010-09-05 ) 990925 Serialize NotSerializableException • Maven URL • http://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient-cache/ 2010-10-03
  13. 13. Apache HttpClient-Cache • Caching : org.apache.http.client.HttpClient : CachingHttpClient • DefaultHttpClient CachingHttpClient • Android Apache HttpClient 4.0 ( ) • alpha ( ) 2010-10-03
  14. 14. Apache HttpClient-Cache • Cache HTTP • HTTP 1.1 • Method: GET • No Header: "Pragma" • No Header: "Cache-Control: no-store" • No Header: "Cache-Control: no-cache" • ※ org.apache.http.impl.client.cache.CacheableRequestPolicy 2010-10-03
  15. 15. Android • Eclipse • Android • Java Build Path Apache HttpClient 4.1 jar 2010-10-03
  16. 16. Android • Apache HttpClient-Cache HTTP • Cache Data Read/Write • • Cache Data Serialize • • ※org.apache.http.client.cache.HttpCacheStorage 2010-10-03
  17. 17. CachingHttpClient DefaultHttpClient Expires: Last-Modified: 281(ms) 122(ms) Etag: File Size: 295 KB Expires: Last-Modified: 50(ms) 125(ms) Etag: File Size: 4KB Expires: Last-Modified: 200 (ms) 128 (ms) Etag: File Size: 8KB ※HTTP GET HTTP Response ※5 ※Nexus One (Android 2.2) Wi-FI ※ : http://www1.axfc.net/uploader/Sc/so/154474.zip 2010-10-03
  18. 18. Caching →CachingHttpClient#execute() 2010-10-03
  19. 19. • Apache HttpClient-Cache • Caching Caching → HTTP Response • 2010 9 • HTTP Response Caching android.webkit 2010-10-03
  20. 20. URL • HTTP/1.1: Caching in HTTP • http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html • Web • http://www.atmarkit.co.jp/fjava/rensai2/webopt12/webopt12.html • Android • http://www.ibm.com/developerworks/jp/opensource/library/os-android- networking/ 2010-10-03
  21. 21. • Web • http://www.amazon.co.jp/dp/4774142042 2010-10-03

×