title: How to avoid a browser request using Expires
body: <p>I'm writing a Java web service for training purposes on web optimisations. My web services send a response that expires in 365 days</p>
  
  <pre><code>@Path("cache2")
  public class WsCache {
      @GET
          @Produces("application/json")
      public Response expires(){
          System.out.println("Expires in 365 days");
          String later = getDaysAfterHttpDate(365);
          return Response.ok("{Hello:hello}").header("Expires",later).build();
      }
  }
  </code></pre>
  
  <p>The problem is that Chrome or Firefox makes it request using cache-control:</p>
  
  <pre><code>GET /fora-comments-ejb/api/cache2 HTTP/1.1
  Host: localhost:8080
  Connection: keep-alive
  Cache-Control: max-age=0
  Accept: text/html...
  User-Agent: Mozilla/5.0 ...
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: fr-FR,fr;...
  </code></pre>
  
  <p>Because any value of <code>max-age</code> overrides <code>Expires</code>, is there a way to say firefox/Chrome not to use cache-control for the second request ?</p>