I want to cache javascript libraries and other static assets - but no HTML whatsoever.

I was under the impression

CACHE MANIFEST

somefiles.js
somemorefiles.js

NETWORK:
*

Would do the job. It caches the html anyway. Please advise.

有帮助吗?

解决方案

The HTML page containing the reference to the cache manifest is always added to the cache. See the specs.

Note: Authors are encouraged to include the main page in the manifest also, but in practice the page that referenced the manifest is automatically cached even if it isn't explicitly mentioned.

其他提示

You can create a hidden iframe with a reference to page with a manifest. Then remove the manifest from your HTML page that you don't want to be cached.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top