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

增加缓存管理 #89

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

增加缓存管理 #89

wants to merge 19 commits into from

Conversation

CodeEagle
Copy link

1.增加DOUCacheManager,可以配置额外的缓存目录。管理缓存数量。
2.优先加载之前下载过的缓存,不用每次联网获取。

@ftkey
Copy link

ftkey commented Dec 10, 2015

shuai!

@ftkey
Copy link

ftkey commented Dec 11, 2015

这种方式做缓存的话,会出现一种问题,假如数据包下载一半或者中途出现错误,缓存音频就有问题了。

要做缓存 1:检查音频ID 2:检查URL 3:检查本地和远程数据包,至少字节数得完全一样。

@CodeEagle
Copy link
Author

是的,要服务器提供一个验证,之后计划添加

@CodeEagle
Copy link
Author

用法:如果配置 DOUCacheManagerverifyClosure就默认开启完整性检查
VerifyClosure 包含两个属性,EtagContentLength 用来检查完整性
调用checkFileCompeletionForURL:方法来移除为下载完整的缓存,
在实现DOUAudioFile协议的类dealoc的时候调用,即可移除

@ftkey
Copy link

ftkey commented Dec 16, 2015

非常强烈期待下个版本~ 最好是有能几个解决方法,一个是网络切换或者错误的时候缓存存储,还有一个是断点续传。

@CodeEagle
Copy link
Author

@ftkey 可以在错误处理的 handler 里面调用 checkFileCompeletionForURL:就会检错
至于断点续传,这个还没打算研究

@LiweiDong
Copy link

帮忙继续完善一下缓存播放和管理吧。。

现在没次播放都要重新下载一遍文件 缓存就是个摆设

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

Successfully merging this pull request may close these issues.

3 participants