cache audio files?

380 views
Skip to first unread message

fytp

unread,
Aug 25, 2016, 11:47:36 PM8/25/16
to Chromium HTML5
Hi all, I have a question about the way caching audio files on html5 pages.
Is there any possibility to cache audio files on html5 pages, which the pages are html5 game pages. Just want to shorten the loading time on opening the html5 game, to improve the performance.

Thanks.

Yehonathan Sharvit

unread,
Aug 26, 2016, 2:30:50 AM8/26/16
to fytp, Chromium HTML5
On chrome, you can use the FilesyStem to store any kind of (big) files.

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.
To post to this group, send email to chromiu...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

PhistucK

unread,
Aug 26, 2016, 3:25:59 AM8/26/16
to Yehonathan Sharvit, fytp, Chromium HTML5
But since it is Chrome only, you better use IndexedDB or some other standardized mechanism.
Or use a service worker with its cache API, which is already supported in Chrome and Firefox and coming to Edge (at least). I believe this is the recommended solution going forward.

Note that you cannot shorten the first load time using those mechanisms, obviously. You will have to schedule the most important files first and then the less used files by yourself.


PhistucK

On Fri, Aug 26, 2016 at 9:30 AM, Yehonathan Sharvit <vie...@gmail.com> wrote:
On chrome, you can use the FilesyStem to store any kind of (big) files.
On Fri, 26 Aug 2016 at 06:47 fytp <fyt...@gmail.com> wrote:
Hi all, I have a question about the way caching audio files on html5 pages.
Is there any possibility to cache audio files on html5 pages, which the pages are html5 game pages. Just want to shorten the loading time on opening the html5 game, to improve the performance.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html5+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html5+unsubscribe@chromium.org.

Joshua Bell

unread,
Aug 26, 2016, 1:28:02 PM8/26/16
to PhistucK, Yehonathan Sharvit, fytp, Chromium HTML5
On Fri, Aug 26, 2016 at 12:25 AM, PhistucK <phis...@gmail.com> wrote:
But since it is Chrome only, you better use IndexedDB or some other standardized mechanism.
Or use a service worker with its cache API, which is already supported in Chrome and Firefox and coming to Edge (at least). I believe this is the recommended solution going forward.


The cache API is exposed to windows and workers, not just service workers (despite currently sharing a spec). You don't need a SW just to get access to the API.
 
It does require a secure context (i.e. HTTPS), though.
Reply all
Reply to author
Forward
0 new messages