cashew icon indicating copy to clipboard operation
cashew copied to clipboard

Async Storage Option

Open instantaphex opened this issue 4 years ago • 5 comments

#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



instantaphex avatar Jul 23 '20 15:07 instantaphex

You're welcome to submit a PR.

NetanelBasal avatar Jul 23 '20 15:07 NetanelBasal

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.

instantaphex avatar Jul 23 '20 15:07 instantaphex

Ah well, I need this too. @instantaphex did you had some time digging into it?

muuvmuuv avatar Aug 24 '22 17:08 muuvmuuv

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 :)

fasidOnGit avatar Nov 13 '22 14:11 fasidOnGit

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 )

DavidWiesner avatar Jan 19 '23 10:01 DavidWiesner