javascript - 我可以使用html5缓存 list 来存储第三方js吗?

标签 javascript html browser-cache cache-manifest


我想在我的 html5 缓存 list 中使用第三方 js。
我不知道我能不能做,如果可能的话怎么做?
我可以在 list 文件中指定完整的第三方 js url 吗?
我已经看到他们在 list 中为图像指定了 http url 的示例,那么为什么我们不能为 js 和 css 做同样的事情呢?
如果我们不能实现它,还有其他选择吗?我知道我们可以在本地存储第三方js。
示例表示赞赏。

最佳答案

根据 html5doctors ,您可以在缓存 list 中设置外部 url。这是一个例子:

CACHE MANIFEST

# This is the cache part where you specify files to cache
CACHE
/some/file.js
/some/other/file.css

http://some.external.url/file.js

如果您想了解更多信息(缓存、回退等),我建议您阅读 html5doctors 的链接。

关于javascript - 我可以使用html5缓存 list 来存储第三方js吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10795268/

相关文章:

javascript - 如何确保socket.io-client消息已被socket.io服务器收到?

php - 圆形动态菜单 - CSS3

javascript - onclick 更改多个表单输入值

html - 如何将这些左/右对齐的标签和表单输入页面居中?

javascript - 启用 JSP 文件中包含的 Javascript、CSS 文件的缓存

html - 手动输入本地开发地址时如何阻止 chrome 搜索

firefox - 影响 twitter 的 firefox 和 chrome 的缓存实现有何不同?

javascript - 模板助手中的 Meteor QuickForm 异常 : Error: Recipes is not in the window scope

javascript - jquery上下文菜单禁用输入

javascript - 初学者 Javascript 学分计算器