如何让应用程序缓存清单在Safari 7.0.3上运行? [英] How to get app cache manifest to work on Safari 7.0.3?
问题描述
我已经迷上了两天了,这让我发疯了。希望有人能对这件事有所启发。
I am already hooked for two days now and it's driving me crazy. Hopefully someone can shine some light on this matter.
我正在运行:
小牛队(MAC),Safari Versie 7.0.3(9537.75.14) )
我的 index.php
看起来像:
<!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>
我的 style.css
如下所示: / p>
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;
}
我的 manifest.php
看起来像:
<?php header('Content- Type: text/cache-manifest'); ?>
CACHE MANIFEST
CACHE:
style.css
如果我跟踪时间输出,它表明它有效,因为除非清单发生变化,否则时间不会更新。我在Chrome中加载了网址并且它可以正常工作,我在Mobile Safari上加载了网址,它可以运行!我在小牛队的Safari中加载了URL,发生了一些古怪的事情。
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.
时间没有按预期更新。当我查看控制台时,我发现它有一个程序缓存。但是,当我从互联网断开连接重新加载页面时,一切似乎都很好。它确实重新加载页面而没有给出我离线的错误,但是没有加载任何像CSS这样的外部文件并且出现以下错误,包括清单本身:
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:
无法加载资源:网络连接处于离线状态。
同样,Chrome和Mobile Safari使用相同的网址正常运行。我看不出我错过了什么。
Again, Chrome and Mobile Safari work correctly with the same URL. I can't see what I am missing.
推荐答案
尝试将清单文件扩展名更改为.appcache:
Try changing the manifest file extension to .appcache:
<html manifest="manifest.appcache">
这篇关于如何让应用程序缓存清单在Safari 7.0.3上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!