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

请教下歌曲切换时缓存问题? #10

Open
shanzhongke opened this issue May 8, 2017 · 2 comments
Open

请教下歌曲切换时缓存问题? #10

shanzhongke opened this issue May 8, 2017 · 2 comments

Comments

@shanzhongke
Copy link

发现你的播放器在每次歌曲切换到新的歌曲时 如果是已经播放过的歌曲 会直接调用缓存返回206 Partial Content (from disk cache) 很好奇这个是怎么实现的?看缓存的返回头部似乎就少了一个Connection?我目前在写一个播放器 但切换时总是重新请求 很费流量 项目是放在githubpage上的 歌曲就在github上 因此有什么办法能从前端实现缓存吗?或者调虾米的api?

@microzz
Copy link
Owner

microzz commented May 8, 2017

@shanzhongke 你好,我把播放记录保存到了localStorage里面,切换实际是从本地读取歌曲名字、url等信息,缓存是浏览器实现的

@shanzhongke
Copy link
Author

好的 感谢

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