adding Files to PreCache List #15016
-
My PWA needs access to a few TensorFlow AI Models. I've put them in my /public folder and the app accesses them just fine when online (It's grabbing them from the server I presume). When Offline, the files aren't part of the PreCache list in service Worker (sw.js), so loading the model fails. I've tried to add them to the workboxOptions in quasar.config.js: But this doesn't seem to work. How do I add files that aren't specifically referenced in the various components to the PreCache List? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
for anyone else who runs into this issue. I eventually figured out that additionalManifestEntries can be passed work workbox generateSW (use extendGenerateSWOptions in quasar.config.js under the pwa object:
|
Beta Was this translation helpful? Give feedback.
-
is there any function to remove folder/route/asset from list ? |
Beta Was this translation helpful? Give feedback.
-
thanks a lot for replying
…On Mon, Feb 27, 2023, 8:08 PM Mike Wilson ***@***.***> wrote:
hi can you give me an example? i don't know how to do it
extendGenerateSWOptions(cfg) { console.log(cfg)
cfg.additionalManifestEntries = [ // additional entries here
'offline.html', ] },
i did this and doesnt work
I would think HTML files would already be configured properly. but make
sure paths are correct too. In my case, I needed to make sure AutoML
(TensorFlow) Models were copied over .. my config looks like this:
extendGenerateSWOptions(cfg) {
cfg.additionalManifestEntries = [
"models/group1-shard1of6.bin",
"models/group1-shard2of6.bin",
"models/group1-shard3of6.bin",
"models/group1-shard4of6.bin",
"models/group1-shard5of6.bin",
"models/group1-shard6of6.bin",
];
and it successfully cached those bin files.
—
Reply to this email directly, view it on GitHub
<#15016 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVKNF3JEIZLLSHMLX64EKZLWZTJ6XANCNFSM6AAAAAASP7VAKA>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
for anyone else who runs into this issue. I eventually figured out that additionalManifestEntries can be passed work workbox generateSW (use extendGenerateSWOptions in quasar.config.js under the pwa object: