@@ -1087,12 +1087,20 @@ registration will fail, but the rest of your web app will remain functional.
10871087in all web browsers. Service worker registration [ won't be attempted] ( src/service-worker-registration.js )
10881088on browsers that lack support.
10891089
1090- 1 . The service worker is only enabled in the [ production environment] ( #Deployment ) ,
1090+ 1 . The service worker is only enabled in the [ production environment] ( #deployment ) ,
10911091e.g. the output of ` npm run build ` . It's recommended that you do not enable an
10921092offline-first service worker in a development environment, as it can lead to
10931093frustration when previously cached assets are used and do not include the latest
10941094changes you've made locally.
10951095
1096+ 1 . If you * need* to test your offline-first service worker locally, build
1097+ the application (using ` npm run build ` ) and run a simple http server from your
1098+ build directory. After running the build script, ` create-react-app ` will give
1099+ instructions for one way to test your production build locally using
1100+ ` pushstate-server ` and the [ deployment instructions] ( #deployment ) have
1101+ instructions for using the python ` SimpleHTTPServer ` . * Be sure to always use an
1102+ incognito window to avoid complications with your browser cache.*
1103+
109611041 . If possible,configure your production environment to serve the generated
10971105` service-worker.js ` [ with HTTP caching disabled] ( http://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours ) .
10981106If that's not possible—[ GitHub Pages] ( #github-pages ) , for instance, does not
0 commit comments