Offline cache issues (Remaining: display checksum of latest commit + date of last update)
Just reporting a few issues with the offline cache function, maybe related to #544.
Noting our main issues: we don't have an easy way to:
- tell if it's being used
- when it was updated
- what version we're using in the demo
We can break out solutions and sub-issues from here. Just want to say the offline cache is AMAZING and has saved me a number of times when demonstrating this to people. Just looking to expand and refine it. Thank you!!!
- [x] can we display the package.json version on the page to show what version we are at?
- [ ] can we also display the checksum of the latest commit?
- [ ] can we show the date of last update?
- [x] the cache version numbering (v3) hasn't changed in a long time. Do we have to manually update this in
examples/sw.js? (I tried but to no effect) - [x] maybe we need it to say something a little more specific, like,
A new version is available. Click to update. - [x] neither button seems to update the cache
- [x] we should document how this works somewhere so we can maintain it
- [x] as in below image, i see 2 links to clear cache
- ~~can we isolate all the cache-related code as much as possible into
/examples/lib/cache/...?~~ (Not possible because of scopes -- @HarshKhandeparkar )

Sent from my OnePlus3 using FastHub
GitMate.io thinks possibly related issues are https://github.com/publiclab/image-sequencer/issues/118 (Assorted improvements to be broken into separate issues), https://github.com/publiclab/image-sequencer/issues/544 (Clear offline cache link not working properly.), https://github.com/publiclab/image-sequencer/issues/48 (A Semantic Issue), https://github.com/publiclab/image-sequencer/issues/227 (PLANNING ISSUE), and https://github.com/publiclab/image-sequencer/issues/388 (Creating a new issue template).
GitMate.io thinks possibly related issues are https://github.com/publiclab/image-sequencer/issues/118 (Assorted improvements to be broken into separate issues), https://github.com/publiclab/image-sequencer/issues/544 (Clear offline cache link not working properly.), https://github.com/publiclab/image-sequencer/issues/48 (A Semantic Issue), https://github.com/publiclab/image-sequencer/issues/227 (PLANNING ISSUE), and https://github.com/publiclab/image-sequencer/issues/388 (Creating a new issue template).
@jywarren the cache seems to be updating, please see the below gif,

To change the cache version number we have to change it manually in sw.js file and then it will get update when we go to the website next time, it does not updates on reload. Please see the gif below :

We can tie the npm version to the cache version, if we can get the value of npm version in sw.js. Do we manually update the value of npm version?
I like the idea to isolate the cache code and would love to work on it! I will remove the other cache button, as it has no use. I would like to document the working as well. Thanks!
Yes, that's exactly what I noticed too, the cache works fine for me.
Some issues are fixed and docs part is mentioned in another issue #761.
Hi all, regarding cache, we don't have an easy way to tell if it's being used, when it was updated, or what version we're using in the demo. I think we should consider turning caching off until we can address these as they may be preventing us from diagnosing and detecting these kinds of issues:
https://github.com/publiclab/image-sequencer/issues/1061
I've updated the issue above to highlight our main problems and added a few more steps that could be broken out.
@jywarren I think we can do something in the long term to improve the service worker, we can build it dynamically using maybe browserify or something. We can keep the code separately and maybe make a grunt task to compile it.
Some parts were completed in #1364
Updated to show 2 remaining pieces - the checksum of the last commit and the date of last update. Thanks!
Confirming this worked (except 2 remaining pieces) for v3.7.1:

