-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional cache support for OkHttp #133
Conversation
@@ -115,4 +116,57 @@ public boolean requestCompleted(boolean success) { | |||
|
|||
return success; | |||
} | |||
|
|||
class InputOutputStream extends InputStream { | |||
InputStream mInputStream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the internal InputStream
here since we already extend it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's a kind of proxy. Do you wish to use super
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't use internally a different InputStream
type than the extended one, we could simplify the implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we could make the inner class static
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll test it later.
Do we need another implementation since OkHttp provides its own response cache and already exists OkHttpFactory(HttpResponseCache)? Reference opensciencemap#89, opensciencemap#100 |
Yes, that cache caches complete HTTP responses. I've implemented the same type of cache as in LwHttp when tile image blob is cached. This:
|
why would we need OkHttp cache without HTTP? And does it really make sense to think about someone changing the engine while keeping the cache? NO! Lastly, there is WAY newer version of OkHttp out there and before making changes like that we should upgrade to that. |
I opened #138 for that. |
Will return to it later after #138 |
@andreynovikov we can close this? |
Add cache support for OkHttp in the same format as LwHttp.