We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我尝试使用okhttp3自带的缓存机制为什么无法使用呢?您使用过自带的缓存机制吗?望回复
The text was updated successfully, but these errors were encountered:
没看太懂,你说的是缓存机制在哪里无法使用?
Sorry, something went wrong.
static Interceptor REWRITE_CACHE_CONTROL_INTERCEPTOR = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { CacheControl.Builder cacheBuilder = new CacheControl.Builder(); cacheBuilder.maxAge(60, TimeUnit.SECONDS); cacheBuilder.maxStale(365,TimeUnit.DAYS); CacheControl cacheControl = cacheBuilder.build(); Request request = chain.request(); request = request.newBuilder() .cacheControl(cacheControl) .build(); Response originalResponse = chain.proceed(request); int maxAge = 60; // read from cache return originalResponse.newBuilder() .removeHeader("Pragma") .header("Cache-Control", "public ,max-age=" + maxAge) .build(); } };
就是自己写的使用okhttp3.0的缓存机制,有木有推荐的缓存办法呢?
No branches or pull requests
我尝试使用okhttp3自带的缓存机制为什么无法使用呢?您使用过自带的缓存机制吗?望回复
The text was updated successfully, but these errors were encountered: