You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried implementing cache control in the plugin and it works partially. For iOS I was able to directly set Cache Policy as urlRequest.cachePolicy = NSURLRequestCachePolicy.UseProtocolCachePolicy; or whatever.
But for Android I noticed that you are making the request with the AAR created by you and not directly with okhttp3.
I thought of rewriting the request function for android of the plugin with OkHttp. However before I start that, I thought of getting in touch with you for a possibility to add cache control parameter to com.klippa.NativeScriptHTTP.Async.Http.MakeRequest(requestOptions, callbackComplete, requestId)
Currently there are 3 parameters in MakeRequest
RequestOptions
CallbackComplete
Request Id Counter
We can add in a fourth Parameter CacheControlPolicy which will be added to the okhttp request.
You must be building a request of okHttp inside the MakeRequest function similar to var request = new okhttp3.Request.Builder(); we can just add the cache control builder to that request to make it work request.cacheControl(cacheControlPolicy);
I have committed my changes to the forked repository here.
Please have a look at the request function in http.ios.ts and http.android.ts and let me know.
The text was updated successfully, but these errors were encountered:
Hi @jerbob92 ,
I tried implementing cache control in the plugin and it works partially. For iOS I was able to directly set Cache Policy as urlRequest.cachePolicy = NSURLRequestCachePolicy.UseProtocolCachePolicy; or whatever.
But for Android I noticed that you are making the request with the AAR created by you and not directly with okhttp3.
I thought of rewriting the
request
function for android of the plugin with OkHttp. However before I start that, I thought of getting in touch with you for a possibility to add cache control parameter tocom.klippa.NativeScriptHTTP.Async.Http.MakeRequest(requestOptions, callbackComplete, requestId)
Currently there are 3 parameters in MakeRequest
We can add in a fourth Parameter
CacheControlPolicy
which will be added to theokhttp request
.You must be building a request of
okHttp
inside theMakeRequest
function similar tovar request = new okhttp3.Request.Builder();
we can just add the cache control builder to that request to make it workrequest.cacheControl(cacheControlPolicy);
I have committed my changes to the forked repository here.
Please have a look at the
request
function inhttp.ios.ts
andhttp.android.ts
and let me know.The text was updated successfully, but these errors were encountered: