File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
cache/src/main/java/io/stanwood/framework/network/cache Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 55
55
* this library. In the future this might be added to the provided interceptors by means of
56
56
* accepting a list of parameter keys instead of just the one of the auth parameter.
57
57
*
58
- * <p>Configuration of the interceptor classes is mainly done by means of request headers. Check
59
- * out {@link CacheHeaderKeys} for more details on what the different headers do.
58
+ * <p>Configuration of the interceptor classes is mainly done via request headers. Check
59
+ * out {@link CacheHeaderKeys} for more details on what the different headers do. Add them to your
60
+ * requests like so:
61
+ * <pre>
62
+ * {@code @Headers({ CacheHeaderKeys.APPLY_RESPONSE_CACHE + ": true" })}
63
+ * </pre>
60
64
*
61
- * <p>Add it as a network interceptor to your OkHttpClient Builder like so:
65
+ * <p>Add instances of this interceptor as a network interceptor to your OkHttpClient Builder like so:
62
66
* <pre>
63
67
* {@code okHttpClientBuilder.addNetworkInterceptor(new CacheNetworkInterceptor("auth", 3600))}
64
68
* </pre>
69
+ *
70
+ * Don't forget to add a cache to the builder as well:
71
+ * <pre>
72
+ * {@code okHttpClientBuilder.cache(new Cache(new File(app.cacheDir, "okhttp-storyly-rest-api-cache"), 10 * 1024))}
73
+ * </pre>
65
74
*/
66
75
public class CacheNetworkInterceptor implements Interceptor {
67
76
You can’t perform that action at this time.
0 commit comments