cashew
cashew copied to clipboard
Async Storage Option
#4 I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
HttpCacheStorage provides a synchronous interface.
Expected behavior
Allow for caching in async storage such as IndexedDB and other async storage options.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
I'm creating an Ionic/Capacitor application and I would like to be able to use Capacitor storage to work around the 5mb localStorage limit. I'm not able to do this because all of the Storage methods return promises.
Environment
All
You're welcome to submit a PR.
Ok great. I don't have time to do it right now, but I'll see if I can dig into it this weekend. Thanks for your work.
Ah well, I need this too. @instantaphex did you had some time digging into it?
I am willing to work on this. @NetanelBasal Do you have any specific approach in mind for this ?
IIUC, We need a totally new provider something like HttpCacheStorageAsync
which should be extendable just like HttpCacheStorage
but asyncified. :thinking:
If you have any tips on where to look or what approach to take please shoot it :)
There is the native Cache Web API wich perfectly match the issue description. In advance you can use different Caches from the CachStorage to provide versioning support. (Just in advance if anybody tries to implement this with the Cache API. There is an known performance issue in chrome when using cache.match
with option ignoreSearch=true
)