manager设置成忽略缓存 重新请求
manager.requestSerializer.cachePolicy = NSURLRequestReloadIgnoringCacheData;
NSURLRequestUseProtocolCachePolicy =0,//默认缓存策略
NSURLRequestReloadIgnoringLocalCacheData =1,//忽略缓存 重新请求
NSURLRequestReloadIgnoringLocalAndRemoteCacheData =4,//未实现
NSURLRequestReloadIgnoringCacheData =NSURLRequestReloadIgnoringLocalCacheData,//忽略缓存 重新请求
NSURLRequestReturnCacheDataElseLoad =2,// 有缓存就用缓存,没有缓存就重新请求
NSURLRequestReturnCacheDataDontLoad =3,// 有缓存就用缓存,没有缓存就不发请求,当做请求出错处理(用于离线模式)
NSURLRequestReloadRevalidatingCacheData =5, // 未实现
网友评论