为什么缓存清单无法让移动Safari在桌面上按预期工作时缓存网站? [英] Why might cache-manifest fail to get mobile Safari to cache site while working as expected on desktop?

查看:180
本文介绍了为什么缓存清单无法让移动Safari在桌面上按预期工作时缓存网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地玩一个简单的网络应用程序,并且无法弄清楚为什么它没有在iPhone上正确缓存。我正在使用正确的MIME类型提供 .manifest 文件,并且该网站在桌面Safari,Chrome和Firefox上打开或关闭本地服务器时效果非常好。只有移动版Safari无法缓存网站。任何想法为什么会这样?

I'm playing around with a simple web app locally, and can't quite figure out why it is not caching correctly on the iPhone. I am serving a .manifest file with the correct MIME-type, and the site works perfectly fine with my local server turned on or off on desktop Safari, Chrome and Firefox. It is only mobile Safari that is failing to cache the site. Any ideas why this might be?

推荐答案

这似乎是一个iOS错误。

It seems to be an iOS bug.

我找到了如果您至少打开了一个Web视图并清除了浏览器缓存,那么移动safari将始终遇到应用程序缓存错误。我认为清除浏览器缓存会破坏缓存数据库。然后,对缓存数据库的所有访问都将失败。似乎浏览器仅在启动时创建此数据库。

I found out that mobile safari will always run into an application caching error if you have at least one web view opened and the you clear the browser cache. I think that clearing the browser cache will destroy the cache database. All accesses to the cache database will then fail. It seems that the browser creates this database only on startup.

要使应用程序缓存再次运行,请关闭所有的safari视图,最后通过返回主屏幕关闭浏览器。现在应用缓存应该工作。有些移动设备也需要打开和关闭。

To get the application cache working again close all safari views and finally close the browser by returning to the home screen. Now applicaton caching should working. Some mobile devices also requires switching on and off.

如果您知道检测到这种情况的方法,请告诉我。

If you know a methode to detect this situation let me know it, please.

这篇关于为什么缓存清单无法让移动Safari在桌面上按预期工作时缓存网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆