title: OkHttp Response caching not works
body: <p>in my android application I am using retrofit for making network download, also I am using OkHttp to cache the response, given below is the code that I wrote</p>
  
  <pre><code> private RestAdapter buildRestAdapter(String baseUrl, Context ctx) {
      RestAdapter.LogLevel logLevel = RestAdapter.LogLevel.FULL;
      RestAdapter.Builder builder = new RestAdapter.Builder();
      builder.setLogLevel(logLevel);
  
      if (!TextUtils.isEmpty(baseUrl))
          builder.setEndpoint(baseUrl);
  
      builder.setRequestInterceptor(new RequestInterceptor() {
          @Override
          public void intercept(RequestFacade request) {
              int maxStale = 60 * 60 * 24 * 28;
              request.addHeader("Cache-Control",
                      "public, only-if-cached, max-stale=" + maxStale);
          }
      });
  
      File httpCacheDirectory = new File(ctx.getCacheDir(), "responses");
      Cache cache = new Cache(httpCacheDirectory, 10 * 1024 * 1024);
      OkHttpClient okHttpClient = new OkHttpClient();
  
      if (cache != null) {
          okHttpClient.setCache(cache);
      }
      builder.setClient(new OkClient(okHttpClient));
      return builder.build();
  }
  </code></pre>
  
  <p>the problem here is when I am making an API call I'm getting failure response and the Error says <code>504 Unsatisfiable Request (only-if-cached)</code></p>
  
  <p>what could be the issue here ? any help will be appreciated</p>