zoukankan      html  css  js  c++  java
  • 离线缓存之RNCachingURLProtocol解析

    主要功能:实现 网页离线加载。基本思想来源于AFCache。作者是Rob Napier(IOSX Programming的作者)。

    使用方法:

    1. To build, you will need the Reachability code from Apple (included). That requires that you link with SystemConfiguration.framework.

    2. At some point early in the program (usually application:didFinishLaunchingWithOptions:), call the following:

      [NSURLProtocol registerClass:[RNCachingURLProtocol class]];

    更多详情,参考http://robnapier.net/offline-uiwebview-nsurlprotocol/简介:将每次的HTTP请求缓存至disk。提交HTTP请求之前,会检查本地是否有缓存。

    不主动清除缓存。不适用有太多HTTP请求的环境。

    解析:

    其他相关:

    Mugunth Kumar写了一个基于REST连接的离线缓存工具MKNetworkKit。

    详情见下一篇。

  • 相关阅读:
    第二章例2-9
    第二章例2-8
    第二章例2-7
    第二章例2-6
    第二章例2-5
    第二章例2-4
    第二章例2-3
    第二章例2-2
    第二章例2-1
    第一章例1-2
  • 原文地址:https://www.cnblogs.com/so-magic/p/3706260.html
Copyright © 2011-2022 走看看