angular / mobile-toolkit

Tools for building progressive web apps with Angular
MIT License
1.34k stars 175 forks source link

i18n and service workers #149

Open spock123 opened 7 years ago

spock123 commented 7 years ago

Hey guys,

  1. The site is translated using the new i18n tools, essentially statically generating an app for each language, serving the languages with different base hrefs ( /en, /da, /de . etc etc).

  2. How do you setup caching in service worker? It's really not feasible to just let the client cache all the application versions, so is the solution really multiple service workers?

Appreciate your thoughts and ideas.

glebmachine commented 7 years ago

I've stuck on the same... @webmaxru @alxhub What are you guys thinking about?

webmaxru commented 7 years ago

Hi! This is pure architecture exercise. Most likely you might want to pre-cache a "default" language, plus you can register a second SW "on demand" when the user switches to another language (and set the corresponding scope for this registration). Some points to keep in mind though: https://stackoverflow.com/a/36004941/1310228