I was making a simple currency converter utility and had to cache the conversion factors after fetching from server. Came up with the below interface. I have basically delegated the caching responsibility to OkHttp itself. Review appreciated.public interface CurrencyConverter {    Interceptor CACHE_CONTROL_INTERCEPTOR = chain -> chain.proceed(chain.request())                                                          .newBuilder()                                                          .header(Cache-Control, String.format(max-age=%d, max-stale=%d, 3600, 0))                                                          .build();    OkHttpClient HTTP_CLIENT = new OkHttpClient.Builder()            .cache(new Cache(new File(System.getProperty(java.io.tmpdir)), 1024 * 1024 * 10))            .addNetworkInterceptor(CACHE_CONTROL_INTERCEPTOR)            .build();    BigDecimal getConversionFactor(String currencyFrom, String currencyTo) throws IOException;    BigDecimal convert(String currencyFrom, String currencyTo, BigDecimal value) throws IOException;}The server is 3rd party and sends a no-cache header which I think does not make sense. It should be safe to cache conversion factors for some duration.
Caching strategy
java;networking;cache