Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache 相关问题汇总 #14

Open
zymxxxs opened this issue Apr 20, 2020 · 2 comments
Open

cache 相关问题汇总 #14

zymxxxs opened this issue Apr 20, 2020 · 2 comments

Comments

@zymxxxs
Copy link
Owner

zymxxxs commented Apr 20, 2020

未验证问题:

  • 目前已知iOS对于 http cache 只有缓存逻辑,没有校验逻辑,但发现缓存逻辑与HTTP Cache 的定义还是有些区别的,目前仅仅只是按照破老师之前逻辑简单了梳理了下(OKHTTP Cache 层的一个子集),具体区别需要后期特别验证。

其他

  • 从目前的效果来看,对于是否使用缓存的逻辑已经与系统保持已知,UT已经覆盖

后续

  • 参考下 swift-libcore-foundation 的实现
@DukeHuang
Copy link

跑TestURLSessionCache.m中关于cache的单元测试全失败了,其它的测试都是通过的

@DukeHuang
Copy link

DukeHuang commented Sep 22, 2023

YMURLCacheHelper.m 中的方法 NS_INLINE NSDate *dateFromString(NSString *v) 如何

传入的 v 是这样的字符串

“Fri, 22 Sep 2023 07:37:05 GMT” 会出现时间解析失败的情况, 导致通过时间去判断是否可以缓存错误,解决办法如下:

static NSDateFormatter *df;
 if (!df) {
     df = [[NSDateFormatter alloc] init];
     df.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];//在这里添加一行代码,可解决我遇到的问题
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants