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
Hi all,
I have a multi lingual website and my assets (js, css, fonts) are versioned (e.g. js-3.1.7/lib/file.js).
I've tried to use after serviceWorker.register to postMessage({comand:"install",version:"3.1.7", language:"en"}), and in sw.js to add an event listener for message. In that event I check for the comand. Then I try in the event listener for install to build my assets to cache, e.g.
js-{version}/lib/file.js
js-{version}/locale/locale-{language}
and my cache name should become
"cache-{version}" for the cacheApi.
But it won't work. I think the event listener for message is not fired when install /register is fired?
How can I fix this. URL-Searchparams may be not a good alternative, because with search params I may register new sw on each language change?
Many thanks.
Michael
The text was updated successfully, but these errors were encountered:
Okay, I see and it worked. Thanks a lot.
But how can I rewrite your sw.js that it is not using async/await? I get errors with uglify.js. Or have I to modify my uglify.js-configs?
Many thanks.
Hi all,
I have a multi lingual website and my assets (js, css, fonts) are versioned (e.g. js-3.1.7/lib/file.js).
I've tried to use after serviceWorker.register to postMessage({comand:"install",version:"3.1.7", language:"en"}), and in sw.js to add an event listener for message. In that event I check for the comand. Then I try in the event listener for install to build my assets to cache, e.g.
and my cache name should become
But it won't work. I think the event listener for message is not fired when install /register is fired?
How can I fix this. URL-Searchparams may be not a good alternative, because with search params I may register new sw on each language change?
Many thanks.
Michael
The text was updated successfully, but these errors were encountered: