我可以在 Chrome 中清除网络应用程序吗?
我编写了一个 Web 应用程序,其中包含其所需的所有 JavaScript 和图像的清单。不幸的是,即使我更改清单文件,它似乎也没有重新加载 JavaScript。
有没有办法从 Chrome 中完全删除 web 应用程序?清除浏览器缓存似乎不起作用。
我在 Mac 上运行 Chrome 5.0.375.55。
非常感谢任何帮助。
I've written a webapp that has a manifest that includes all the javascript and images that it requires. Unfortunately, even when I change the manifest file, it doesn't seem to reload the javascript.
Is there a way to delete the webapp completely from Chrome? Clearing the browser cache doesn't seem to work.
I'm running Chrome 5.0.375.55 on a Mac.
Any help very gratefully received.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
添加像
?foo=12345
这样的 get 参数会将您的文件视为不同的文件,从而重新缓存它,但不会清除现有文件的任何缓存。输入:
你就会幸运:)
Adding a get parameter like
?foo=12345
will treat your file as a different one and therefore recache it, but NOT clear any cache for the existing file.Type:
and you'll get Lucky :)
苹果对此有一些非常好的文档,虽然操作起来有点棘手,但它确实使整个清单过程更加透明。此外,我发现 Safari(尤其是 Mobile Safari)比 Firefox 更一致地显示这些事件响应;虽然 Chrome 应该非常接近 Safari,但我不太确定。
不过,问题的根源是:
Google 在此处。
基本上,您可以使用
window.applicationCache.status
构建一系列if else
测试,以便清楚地了解系统正在做什么。来自 Apple:
例如,您可以按如下方式获取 DOMApplicationCache 对象:
您可以按如下方式检查应用程序缓存的状态:
如果应用程序缓存处于 UPDATEREADY 状态,那么您可以通过向其发送 update() 消息来更新它,如下所示如下:
如果更新成功,则交换新旧缓存,如下:
Apple has some really good documentation on this, it is a bit tricky to get going but it does make the whole manifest process way more transparent. In addition, I find Safari (esp. Mobile Safari) shows these event responses more consistently than Firefox; not sure about Chrome though it should be pretty close to Safari.
The root of your question though:
Google has a good post here.
Basically you can build a series of
if else
tests with thewindow.applicationCache.status
for a clear look at what the system is doing.From Apple:
For example, you get the DOMApplicationCache object as follows:
You can check the status of the application cache as follows:
If the application cache is in the UPDATEREADY state, then you can update it by sending it the update() message as follows:
If the update is successful, swap the old and new caches as follows:
它也缓存服务器端吗?尝试在 url 中添加像 ?foo=12345 这样的 get 参数,看看是否获得更新的文件。
Is it cached server side as well? Try adding a get parameter like ?foo=12345 to the url and see if you get the updated file.
没有(据我所知)
人们似乎希望提问者接受一个答案,但没有人真正回答过这个问题。我不是专家,但我已经搜索了很多,我认为“否”是正确的,并回答了所提出的问题。
No (as far as I know)
It seems that people want the questioner to accept an answer, but no one has actually answered the question. I am no expert, but I have been searching a lot, and I think "No" is correct, and answers the question as posed.