jjzjj

ByProtocol

全部标签

ios - 如何使用 NSURLCache 来缓存由 NSURLProtocol 服务的内容

我已经编写了一个NSURLProtocol,它将检查出站http请求是否针对URL到本地路径映射的plist并提供本地内容,然后使用NSURLCache:缓存它-(void)startLoading{//Couldthisbewhymyresponsesnevercomeoutofthecache?NSURLResponse*response=[[NSURLResponsealloc]initWithURL:self.request.URLMIMEType:nilexpectedContentLength:-1textEncodingName:nil];//Getthelocallys