title: Why is it considered dangerous to overwrite cache control headers?
body: <p>I am using Retrofit/OkHTTP to consume a REST API which doesn't provide proper cache headers. In order to work around this, I've written a cache interceptor which will add cache control headers to the response. </p>
  
  <p>I have seen in multiple places this is considered dangerous, for example the okhttp recipe for this has the following comment:</p>
  
  <p><code>/** Dangerous interceptor that rewrites the server's cache-control header. */</code></p>
  
  <p>(<a href="https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java#L27" rel="nofollow noreferrer">source</a>)</p>
  
  <p>Why exactly is this considered to be dangerous? I'd like to understand the risks of doing this.</p>