cacheapi

How to load website offline from base url using Service Workers and Cache Api?

你。 提交于 2021-01-29 18:53:58
问题 When you visit this web site https://bugs.stringmanolo.ga/index.html, while navigating around the main.js file is calling a method from ff.js file to cache a good amount of the resources. So next time you land to the web the files are directly taken from your browser cache without make any request. This means if you visited my website before, you can load it again without internet conection. The problem is, this only works if you directly time the index.html file in the addressbar. Lame. Thid

HTML Audio element source from cache

让人想犯罪 __ 提交于 2019-12-24 00:59:36
问题 I am building a web application for playing some audio files offline. I have read and tested the Cache part of the Service Worker API, and I can easily add all my audio files to a named cache. However, the browser does not seem to use it when I add a <audio src='/audio/file.mp3'> to the DOM and play() it, even if that exact URL is added to a cache. It makes sense in some way that the cache is not automatically used, as then it would not be any point in naming the cache. I am using create