TiExtendNW
TiExtendNW copied to clipboard
Missing option to activate the cache from Titanium
Hey! Nice job wrapping the MKNetworkKit. It really has some nice features we would like to use! Unfortunately I have been unable to activate caching. The MKNetworkKit Documentation states that you have to call this method manually.
[[MKNetworkEngine sharedEngine] useCache];
Did I miss something?
Cheers!
@trueter Hi trueter! Thank you for your interest in this module!
Please set "http.cache = true;
" after call open method, If you want activate caching.
exp)
var module = require('net.imthinker.ti.extendnw'),
http = module.createHTTPClient();
http.open('GET', 'http://httpbin.org/ip', {
forceReload: false
}); // -> Call "self.engine = [MKNetworkkit sharedEngine]" in module.
http.cache = true; // Set [self.engine useCache];
http.send();
MKNetworkKit have not sharedEngine
method...
I do complicated, but it is necessary to prepare yourself this method (Were prepared methods with the same name referring to the document in this module) .
Can you try with this? Thanks!