HTML5 appcache for media only
-
26-10-2019 - |
Question
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.
Solution
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.
OTHER TIPS
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow