Page 1 of 1

cache service response

Posted: Tue May 07, 2013 8:07 pm
by Stefano Padrin

hi

it's possible to cache response of the service?

i want ..
check connection
if (device is online) then call the service (and cache the result)
otherwise use the cache
it's possible? and how?


cache service response

Posted: Tue May 07, 2013 8:17 pm
by maxkatz

Apache Cordova (PhoneGap) included in every project has API to check if you are connected. As for saving the response, you can save it in local storage, for example.


cache service response

Posted: Tue May 07, 2013 8:41 pm
by Stefano Padrin

ok... but, how can wrap all my services with this control (cache and storage)?

apperyio files code are immedicable, it's right?


cache service response

Posted: Tue May 07, 2013 8:53 pm
by maxkatz

You could use Generic Service as one option.

You can also invoke a service from JavaScript, for example:
rest_service_name.execute({});

and then add any logic around it.