简体   繁体   English

从脚本中的远程域加载文件时,AppCache'miss'吗?

[英]AppCache 'miss' when file is loaded from remote domain in script?

We use Appcache of our SubToMe button. 我们使用的应用程序缓存我们的SubToMe按钮。

The benefit of loading the code once from the server and then keeping everything in the user browser is exactly what we want and it works grear. 从服务器一次加载代码,然后将所有内容保留在用户浏览器中的好处正是我们想要的,并且可以正常工作。 By loading in Chrome, you'll see in the dev console that all files are loaded the first time, and if you refresh that no other file is ever loaded. 通过在Chrome中加载,您会在开发人员控制台中看到所有文件均是首次加载,如果刷新,则不会再加载其他文件。

However, the button is meant to be loaded form other sites like on a blog . 但是,该按钮旨在从其他站点(例如Blog)加载。 The html button has a onclick listener which will just add a script element with an src point to https://www.subtome.com/load.js . html按钮具有一个onclick侦听器,该侦听器仅将带有src点的script元素添加到https://www.subtome.com/load.js For some reason, this file is not loaded via Appcache, even though it is in the manifest and if you get it directly (by putting its url in the browser bar), then it is fetched from AppCache. 出于某种原因,这个文件不是通过应用程序缓存加载,即使它是在清单中,如果你得到它直接(通过将它的网址在浏览器栏),那么它从应用程序缓存牵强。

Anyone knows how we can force the browsers to use the Appcache version when loaded from a 3rd party site? 有谁知道从第三方网站加载后如何强制浏览器使用Appcache版本? Or is that not possible with Appcache. 还是使用Appcache无法做到这一点。

"Over SSL, all resources in the manifest must respect the same-origin policy." “通过SSL,清单中的所有资源都必须遵守同源策略。”

See http://appcachefacts.info 请参阅http://appcachefacts.info

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM