Offline data cache for Cordova Mobile application
up vote
0
down vote
favorite
I have a Cordova application (Ionic3/Angular) where I wish to add offline data cache, where I would also like to prefetch some of the data, even if the user does not go to the view that would normally invoke the request for that data.
Most caching posts I find have to do with caching web assets such as the actual application files, rather than data fetched via ajax. In my case, (Cordova), I already have all these, I just need to cache the data. For the asset caching, I see toolbox mentioned a lot and being run from within a service worker.
Can toolbox be used for this? Also, does toolbox need to be used in a service worker (worried about iOS support).
If not toolbox, is there something more appropriate I can use for this?
Thanks in advance for any pointers.
cordova ionic-framework progressive-web-apps offline-caching
add a comment |
up vote
0
down vote
favorite
I have a Cordova application (Ionic3/Angular) where I wish to add offline data cache, where I would also like to prefetch some of the data, even if the user does not go to the view that would normally invoke the request for that data.
Most caching posts I find have to do with caching web assets such as the actual application files, rather than data fetched via ajax. In my case, (Cordova), I already have all these, I just need to cache the data. For the asset caching, I see toolbox mentioned a lot and being run from within a service worker.
Can toolbox be used for this? Also, does toolbox need to be used in a service worker (worried about iOS support).
If not toolbox, is there something more appropriate I can use for this?
Thanks in advance for any pointers.
cordova ionic-framework progressive-web-apps offline-caching
If you are only looking to cache ajax requests, you can manually do so by storing them the localstorage (or usingNativeStorageplugin). You can write a javascript class like functions that all your code calls to when doing ajax request. This class can then check whether if the request is cached or not. You would have to store a special key (the url should do) so you can find the difference between all the data you have.
– kks21199
Nov 5 at 3:35
Thanks @kks21199, I was hoping there was some library that would do some of this stuff for "free" (ie intercept, and have caching strategoies similar to toolbox)
– peterc
Nov 5 at 5:04
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a Cordova application (Ionic3/Angular) where I wish to add offline data cache, where I would also like to prefetch some of the data, even if the user does not go to the view that would normally invoke the request for that data.
Most caching posts I find have to do with caching web assets such as the actual application files, rather than data fetched via ajax. In my case, (Cordova), I already have all these, I just need to cache the data. For the asset caching, I see toolbox mentioned a lot and being run from within a service worker.
Can toolbox be used for this? Also, does toolbox need to be used in a service worker (worried about iOS support).
If not toolbox, is there something more appropriate I can use for this?
Thanks in advance for any pointers.
cordova ionic-framework progressive-web-apps offline-caching
I have a Cordova application (Ionic3/Angular) where I wish to add offline data cache, where I would also like to prefetch some of the data, even if the user does not go to the view that would normally invoke the request for that data.
Most caching posts I find have to do with caching web assets such as the actual application files, rather than data fetched via ajax. In my case, (Cordova), I already have all these, I just need to cache the data. For the asset caching, I see toolbox mentioned a lot and being run from within a service worker.
Can toolbox be used for this? Also, does toolbox need to be used in a service worker (worried about iOS support).
If not toolbox, is there something more appropriate I can use for this?
Thanks in advance for any pointers.
cordova ionic-framework progressive-web-apps offline-caching
cordova ionic-framework progressive-web-apps offline-caching
asked Nov 5 at 3:31
peterc
1,3522550
1,3522550
If you are only looking to cache ajax requests, you can manually do so by storing them the localstorage (or usingNativeStorageplugin). You can write a javascript class like functions that all your code calls to when doing ajax request. This class can then check whether if the request is cached or not. You would have to store a special key (the url should do) so you can find the difference between all the data you have.
– kks21199
Nov 5 at 3:35
Thanks @kks21199, I was hoping there was some library that would do some of this stuff for "free" (ie intercept, and have caching strategoies similar to toolbox)
– peterc
Nov 5 at 5:04
add a comment |
If you are only looking to cache ajax requests, you can manually do so by storing them the localstorage (or usingNativeStorageplugin). You can write a javascript class like functions that all your code calls to when doing ajax request. This class can then check whether if the request is cached or not. You would have to store a special key (the url should do) so you can find the difference between all the data you have.
– kks21199
Nov 5 at 3:35
Thanks @kks21199, I was hoping there was some library that would do some of this stuff for "free" (ie intercept, and have caching strategoies similar to toolbox)
– peterc
Nov 5 at 5:04
If you are only looking to cache ajax requests, you can manually do so by storing them the localstorage (or using
NativeStorage plugin). You can write a javascript class like functions that all your code calls to when doing ajax request. This class can then check whether if the request is cached or not. You would have to store a special key (the url should do) so you can find the difference between all the data you have.– kks21199
Nov 5 at 3:35
If you are only looking to cache ajax requests, you can manually do so by storing them the localstorage (or using
NativeStorage plugin). You can write a javascript class like functions that all your code calls to when doing ajax request. This class can then check whether if the request is cached or not. You would have to store a special key (the url should do) so you can find the difference between all the data you have.– kks21199
Nov 5 at 3:35
Thanks @kks21199, I was hoping there was some library that would do some of this stuff for "free" (ie intercept, and have caching strategoies similar to toolbox)
– peterc
Nov 5 at 5:04
Thanks @kks21199, I was hoping there was some library that would do some of this stuff for "free" (ie intercept, and have caching strategoies similar to toolbox)
– peterc
Nov 5 at 5:04
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Besides the method mentioned by @kks21199 , Angular does provide a way to cache http requests. Read here for more details.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Besides the method mentioned by @kks21199 , Angular does provide a way to cache http requests. Read here for more details.
add a comment |
up vote
0
down vote
Besides the method mentioned by @kks21199 , Angular does provide a way to cache http requests. Read here for more details.
add a comment |
up vote
0
down vote
up vote
0
down vote
Besides the method mentioned by @kks21199 , Angular does provide a way to cache http requests. Read here for more details.
Besides the method mentioned by @kks21199 , Angular does provide a way to cache http requests. Read here for more details.
answered Nov 5 at 9:56
Delwyn Pinto
685
685
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53147952%2foffline-data-cache-for-cordova-mobile-application%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
If you are only looking to cache ajax requests, you can manually do so by storing them the localstorage (or using
NativeStorageplugin). You can write a javascript class like functions that all your code calls to when doing ajax request. This class can then check whether if the request is cached or not. You would have to store a special key (the url should do) so you can find the difference between all the data you have.– kks21199
Nov 5 at 3:35
Thanks @kks21199, I was hoping there was some library that would do some of this stuff for "free" (ie intercept, and have caching strategoies similar to toolbox)
– peterc
Nov 5 at 5:04