1:做蜂雷时 遇到的一个疑难杂症 用户不论是否登录请求到的数据 都包含上家店的storeid 解决方案 禁用缓存 不知道什么元婴导致
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];
configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
configuration.HTTPShouldSetCookies=NO;
configuration.HTTPCookieAcceptPolicy=NSHTTPCookieAcceptPolicyNever;
configuration.HTTPCookieStorage=nil;
configuration.URLCache=nil;
2:
蜂雷用户头像url地址不变 图片内容改变 解决方案
之前的版本这么改是有效的,不过后来就不行了,我也来更新一下这篇文章;除了上面的修改之外,我们还需要在SDWebImage的内部,SDWebImageManager.m文件中,大概176行左右吧,把之前的代码:(如下)
if (image && options & SDWebImageRefreshCached) {
// force progressive off if image already cached but forced refreshing
downloaderOptions &= ~SDWebImageDownloaderProgressiveDownload;
// ignore image read from NSURLCache if image if cached but force refreshing
downloaderOptions |= SDWebImageDownloaderIgnoreCachedResponse;
}
更换成如下代码:
if (image && options & SDWebImageRefreshCached) {
// force progressive off if image already cached but forced refreshing
downloaderOptions &= ~SDWebImageDownloaderProgressiveDownload;
// remove SDWebImageDownloaderUseNSURLCache flag
downloaderOptions &= ~SDWebImageDownloaderUseNSURLCache;
// ignore image read from NSURLCache if image if cached but force refreshing
downloaderOptions |= SDWebImageDownloaderIgnoreCachedResponse;
}
作者:First灬DKS
链接:https://www.jianshu.com/p/6fd2061c1c5b
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。