Omit current page from HTML5 offline appcache but use cached resources

拈花ヽ惹草 提交于 2019-11-30 13:59:37

My answer is "yes".

I have worked on a web-app where I listed all the necessary resources in the manifest, and set the NETWORK section to *.

The manifest is then included only on the main landing page. So all resources are cached the first time you visit the site and and it works a treat.

In short,

  • one of your pages must include the manifest and will therefore be cached.

    maybe you can have the manifest loaded in a iframe and not have the whole page cached, just a thought.

  • list all your resources to be cached in the CACHE section

  • set the NETWORK section to *

I'm fairly certain that the answer to this is no. If you use the Network section in Chrome, then it shows which resources are loaded from the cache and which are loaded from the server. I have attempted to set the appcache as described above and the resources are always loaded from the server. Would I be correct in assuming that if the current page is not in the appcache then it wont bother to check in the appcache for any of the resources?

What I've found that is working is to list those files that you don't want cached in appcache in the NETWORK: section of the manifest. For me, that meant adding *.asp* to the network section. Now, none of the classic asp files, or aspx files are cached.

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