title: spring boot cache control is not working properly. max age gets reset to 0
body: <p>i am trying to build my app with spring boot 1.4.3. I tried set max age as </p>
  
  <pre><code>@Configuration
  public class MvcConfig extends WebMvcConfigurerAdapter {
  
  @Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
      registry
        .addResourceHandler("/css/**")
        .addResourceLocations("classpath:/static/css/")
        .setCacheControl(CacheControl.maxAge(30, TimeUnit.DAYS));
      }
  }
  </code></pre>
  
  <p>when i access my page first time, i can see response headers with Status=200, as</p>
  
  <pre><code>Accept-Ranges=bytes
  Cache-Control=max-age=2592000
  </code></pre>
  
  <p>Next time when i access same page second time, i can see Status=304 but headers are -</p>
  
  <pre><code>Cache-Control=no-cache, no-store, max-age=0, must-revalidate
  Date=Wed, 11 Jan 2017 16:05:12 GMT
  Expires=0
  </code></pre>
  
  <p>Because of this when i access third time, all my static resources were fetched from server and not the cached one. Can some one help me what i am missing or doing wrong? Thanks in Advance.</p>