Comments (2)
Thanks! I'll update.
On Fri, Sep 25, 2015 at 11:01 PM, Jeffrey Posnick [email protected]
wrote:
The code in
https://github.com/samdutton/simpl/blob/master/serviceworker/js/sw.js
precaches a list of resources in oninstall and then uses a cache-first
approach in the onfetch handler to serve the responses. The cached
entries are never updated outside of the oninstall handler.In practice, this means that the resources which are cached the very first
time the page is opened on a given browser will be used indefinitely, until
the service worker's code is modified and oninstall is triggered again.
If you intend for this behavior, it should be highlighted prominently in
the comments/docs, as it's a non-trivial behavior that I'm sure most
developers won't be aware of. Most developers would assume that if they
modified, e.g., main.js, then that change would (eventually) trickle down
to their existing users.Instead, I'd recommend following this example
https://github.com/GoogleChrome/samples/blob/gh-pages/service-worker/prefetch/service-worker.js#L27
and include an explicit cache versioning string in the service worker
script, along with instructions to developers that it needs to be bumped
each time a precached file changes.Bonus points if you also cache-bust
https://github.com/GoogleChrome/samples/blob/gh-pages/service-worker/prefetch/service-worker.js#L56
the URLs used in the oninstall handler to ensure that when the cache
version string is updated, it actually results in a fresh resource being
retrieved from the network.—
Reply to this email directly or view it on GitHub
#68.
from simpl.
Closing this — I added a large warning to the code a while back, and I'll update it at some stage.
from simpl.
Related Issues (20)
- alpha compatibility of webm files on mobile devices HOT 1
- set recorded video resolution HOT 1
- i'm find it not work on my anroid mobile default browser HOT 5
- getUserMedia example on iOS HOT 4
- Not working in safari 12.1.1 HOT 6
- how to store the image to the folder - framework codeigniter HOT 3
- How to set default Camera2 0 ?
- Read Qr
- New To This HOT 1
- record all participant HOT 1
- a simple webpage for joining a sports activity HOT 5
- Not working on iphone SE HOT 19
- Note object.observe removal HOT 1
- websocket.org cannot connect HOT 1
- Blob Size getUserMedia HOT 4
- How is this suppose to communicate to another web browser page? HOT 4
- timeslice must be multiples of 60 HOT 1
- Feature Request: Load overlay image HOT 2
- Can i add Restaurant landing page using REACT
- BUG: "input names" demo webpage URL source link points to "input TYPES" source folder on GH (instead of "input NAMES")
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpl.