开发者

caching kills links (jquery mobile on iPad)

开发者 https://www.devze.com 2023-04-08 18:40 出处:网络
I am working on a webapplication that uses caching to make it available offline. Everything works fine when running it开发者_开发知识库 chrome (offline and online). But when I run it on iPad the links

I am working on a webapplication that uses caching to make it available offline. Everything works fine when running it开发者_开发知识库 chrome (offline and online). But when I run it on iPad the links don't work anymore and I get failed to load page everywhere. Removing the caching makes the links work again so it obviously has something to do with the caching. Navigating directly to the seperate pages of the webapp also works fine in Safari, its the link that causes the error. By default all links are loaded with AJAX in jQuery Mobile. Changing this by adding rel="external" also fixes the problem, but obviously I don't want to do that.

To enable caching I added this code: and created a manifest file with ALL the files (scripts, css, images, html). Does anyone know what the problem could be?


I've experienced this as well while working with caching using manifests. What I discovered was that there Chrome has no limits. iPad and iPhone do. This appears to be pretty small, around 5mb. Try removing images as much as possible and using YUI Compressor on your scripts.

Ajax requests can be cached actually, the system doesn't care if the request is by AJAX or normal full request. All you have to do is put the URLs you wanted to retrieve by ajax into the manifest like the rest of the assets.

Hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号