Create-react-app: Updating service worker on every deployement.

Created on 25 Oct 2017  路  2Comments  路  Source: facebook/create-react-app

Hi,

I'm trying to update my service worker on every fresh deployment on firebase server but I can't find any way on how to do it.

question > PWA

Most helpful comment

Hello @rawris鈥擳he most relevant thing to keep in mind when ensure your service worker updates in a timely manner when using Chrome is to disable HTTP caching of your service-worker.js file on your server. There's more information at https://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours/38854905#38854905

Configuring this in Firebase is fairly straight forward; here's an example (swap out /sw.js for /service-worker.js): https://github.com/googlearchive/workbox-microsite/blob/eaee7d0899c582afe1b2a327777c1906368c1624/firebase.json#L4

All 2 comments

@jeffposnick

Hello @rawris鈥擳he most relevant thing to keep in mind when ensure your service worker updates in a timely manner when using Chrome is to disable HTTP caching of your service-worker.js file on your server. There's more information at https://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours/38854905#38854905

Configuring this in Firebase is fairly straight forward; here's an example (swap out /sw.js for /service-worker.js): https://github.com/googlearchive/workbox-microsite/blob/eaee7d0899c582afe1b2a327777c1906368c1624/firebase.json#L4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dualcnhq picture dualcnhq  路  3Comments

stopachka picture stopachka  路  3Comments

adrice727 picture adrice727  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

jnachtigall picture jnachtigall  路  3Comments