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

fix issue that fail to load large file as json #101

Merged
merged 1 commit into from Jun 21, 2019

Conversation

@holycanvas
Copy link

commented Jun 18, 2019

adapter里面适配XMLHttpRequest时,默认以json格式来下载,然后又stringify为text,用户又parse为json,浪费时间,甚至崩溃,改为除了arraybuffer外,其他默认以text类型来下载,如果是请求json再parse为json,请求text就返回text,减少多余的stringify和parse。

解决论坛里反馈的 cleanAllCaches里,会删除大部分没有使用到的缓存,如果在writeCacheFile的时候,恰好之前也在写这个文件,那么其实最新的cachedFiles并没有被写成功,而在callback里就直接对相关文件进行了删除, 再加了一个检测,检测是否正在写文件中,对于正在写文件中的时候,callback应该留到下次执行

@pandamicro pandamicro merged commit bda06c9 into cocos-creator-packages:v2.1.2 Jun 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.