我正在使用AFNetworking来处理所有的http和https请求,我确实认为我没有为它设置任何缓存策略.如何删除或停止应用程序缓存请求的网址?我不希望我的用户(那些有root用户访问他们的手机/越狱设备的用户)看到这些网址.
同时,这是我的获取请求的示例
-(voID){ // Obtain Manager AFhttpRequestoperationManager *manager = [self gethttpRequestoperationManager]; [manager GET:_path parameters:[self getRequestParams] success:[self getoperationSuccessBlock] failure:[self getoperationFailureBlock]];}- (AFhttpRequestoperationManager *)gethttpRequestoperationManager { self.operationManager = [APlacesProvIDerRequest manager:_basePath]; return self.operationManager;}解决方法 从 AFNetworking github site开始:
Unlike NSURLConnection objects,which each share application-wIDe
settings for session management,cache policIEs,cookie storage,and
URL protocols,NSURLSession objects can configure these all
indivIDually. Once a session is initialized with a particular
configuration,it can dispatch tasks to fetch data,and upload or
download files.
所以我想你可能会尝试使用该属性(我没有设备,所以我无法检查是否有效).
无论如何你可以尝试:[[NSURLCache sharedURLCache] removeAllCachedResponses];
总结以上是内存溢出为你收集整理的如何在AFNetworking iOS中禁用请求缓存?全部内容,希望文章能够帮你解决如何在AFNetworking iOS中禁用请求缓存?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)