So I have this simple html file

<!DOCTYPE HTML>
<html manifest="cache.manifest"><head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Test</title>
<meta http-equiv="content-type" content="text/html">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">

<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
    <h1>hello</h1>
</body>
</html>

My cache.manifest is simply

CACHE MANIFEST

I run this website on my local server (localhost). I load it from iphone safari and it works fine. I then stop the server and load it again, and it works, because the offline cache is doing its job. However... if I save the website as a start icon in the iphone dashboard, and then I try to open it with the server stopped it won't load. However... if I open it with the server running at least once (it will work) then I can open it later without problem.

It looks like even though the page was cached in safari, it is not cached in this saved app. Anybody knows how to get around this?

有帮助吗?

解决方案

The reason for that is because Safari uses a different cache than WebClips. The fact that is cached in Safari does not mean it will be cached if you create a webClip from it. You need to access the webclip at least once to cache it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top