-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basket.js.next and Service Worker #131
Comments
The future is definitely with the SW Cache API and not localStorage.
If so, what would it add it add upon Shed?
Isn't that what Shed is attempting to do? |
@sindresorhus Shed is intended to be a general set of tools for SW On Mon, 29 Dec 2014 10:33 Sindre Sorhus [email protected] wrote:
|
Then yes. I think Basket.js should be rewritten to depend on Shed. |
Let's coordinate with Mat when Shed is ready for broader use then :) |
Update: We're planning on exposing the Cache API as a global (probably in Chrome 43) per https://chromium.googlesource.com/chromium/blink/+/53d80dc622ba866d563d4934c98777a42d4c3e96. This would open up the door to basket switching over to using that API. We have some choices there. Do we become a tiered solution? i.e if Cache API is present, use that, otherwise use localStorage - or - do we attempt to switch to a Cache API polyfill (which would mean relying on IndexedDB) |
IndexDB doesn't have perfect browser support: http://caniuse.com/#search=IndexedDB So not sure. Depends on what browsers we want to target. |
While IdexedDB support level is acceptable, it's init is not free. A week ago we had to investigate why JS starts with noticeable delay at our site (we used bag.js with indexeddb prefered storage). Result is:
No ideas now to reduce this :( |
@wibblymat is currently working on a new caching library called Shed that builds on top of Service Worker's Cache API.
In the past, we've discussed how we think the Cache API might be a more suitable destination for cached scripts and stylesheets than localStorage and with Chrome now supporting it natively, it's worth us discussing whether basket should evolve, or stay the same.
I see there being two paths here:
basket.js stays as is, a focused POC library for script/asset caching that just uses localStorage. We maintain updates to it to keep it working but otherwise don't plan to evolve it further.
basket.js is refactored to support SW caching. We either consume Shed or implement a lightweight layer that uses the Cache API polyfill to support other browsers but ultimately switch from localStorage to the newer API for where assets get cached.
I'm interested in thoughts on whether this makes sense at all and what folks think :) cc @passy @sindresorhus . Ideally, would love to avoid duplication of efforts.
The text was updated successfully, but these errors were encountered: