You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far, it was impossible for a ServiceWorker to read the ZIM file directly.
So we setup a MessageChannel with the main javascript thread, transfer the "request" to the main thread, which reads the ZIM file, and transfers the content back to the ServiceWorker.
It means that we might be able to transfer the ZIM files (as ReadableStreams) to the ServiceWorker. So that the ServiceWorker would be able to directly make use of our "backend" to read the ZIM.
Unfortunately, this will only work with recent versions of browser engines. We'll have to keep the current MessageChannel logic for older ones (at least IE11, Firefox OS, Windows Mobile, maybe Ubuntu Touch).
But this might improve performance, and might also allow to make use of bigger parts of the C libraries, like considered in kiwix/libkiwix#740
The text was updated successfully, but these errors were encountered:
So far, it was impossible for a ServiceWorker to read the ZIM file directly.
So we setup a MessageChannel with the main javascript thread, transfer the "request" to the main thread, which reads the ZIM file, and transfers the content back to the ServiceWorker.
When discussing in kiwix/libkiwix#740, I discovered that recent browsers can now transfer a https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream, and that we can get such a ReadableStream from our File object: https://developer.mozilla.org/en-US/docs/Web/API/Blob/stream
It means that we might be able to transfer the ZIM files (as ReadableStreams) to the ServiceWorker. So that the ServiceWorker would be able to directly make use of our "backend" to read the ZIM.
Unfortunately, this will only work with recent versions of browser engines. We'll have to keep the current MessageChannel logic for older ones (at least IE11, Firefox OS, Windows Mobile, maybe Ubuntu Touch).
But this might improve performance, and might also allow to make use of bigger parts of the C libraries, like considered in kiwix/libkiwix#740
The text was updated successfully, but these errors were encountered: