How to get app cache manifest to work on Safari 7.0.3?

二次信任 提交于 2019-12-22 05:39:14

问题


I am already hooked for two days now and it's driving me crazy. Hopefully someone can shine some light on this matter.

I am running: Mavericks (MAC), Safari Versie 7.0.3 (9537.75.14)

My index.php looks like:

<!DOCTYPE HTML>
<html manifest="manifest.php">
<head>
    <title></title>

    <meta charset="UTF-8" /> 
    <link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
    <p>The time is <time><?php echo time(); ?></time></p>
</body>
</html>

My style.css looks like:

html, body
{
    margin      : 0;
    padding     : 0;
    font-size   : 100%;
    font-family : "Helvetica Neue", Helvetica, Verdana, Arial, sans-serif;
}

p
{
    text-align : center;
}

p time
{
    color : red;
}

And my manifest.php looks like:

<?php header('Content- Type: text/cache-manifest'); ?>
CACHE MANIFEST
CACHE:
style.css

If I track the time output, it shows that it works, since the time doesn't get updated unless the manifest changes. I load the URL in Chrome and it works, I load the URL on Mobile Safari and it works! I load the URL in Safari on Mavericks and something wacky happens.

The time doesn't get updated as expected. When I look in the console, I see it has a program cache. All seems fine, however, when I disconnect from the internet en reload the page. It does reload the page without giving an error that I am offline, however any external file like the CSS is not loaded and gives the following error including the manifest itself:

Failed to load resource: The network connection is offline.

Again, Chrome and Mobile Safari work correctly with the same URL. I can't see what I am missing.


回答1:


Try changing the manifest file extension to .appcache:

<html manifest="manifest.appcache">


来源:https://stackoverflow.com/questions/22912919/how-to-get-app-cache-manifest-to-work-on-safari-7-0-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!