Skip to content
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

Use cache finally #1689

Closed
wants to merge 1 commit into from
Closed

Use cache finally #1689

wants to merge 1 commit into from

Conversation

yegorius
Copy link

@yegorius yegorius commented Jun 8, 2015

I've been having the same problem as discussed in #831
I noticed that cache and internalCache are both null for OkHttpClient instance in HttpEngine::sendRequest().
Also call .setUseCaches(true) to jump over the check in HttpURLConnectionImpl::newHttpEngine() line 358.

@@ -342,7 +342,7 @@ InternalCache internalCache() {

public OkHttpClient setCache(Cache cache) {
this.cache = cache;
this.internalCache = null;
this.internalCache = cache.internalCache;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is really nasty 😄

@swankjesse
Copy link
Member

I don't follow this at all. Could you provide a failing test that this fixes?

@swankjesse
Copy link
Member

Ping on a failing test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants