JBoss7 setting Cache-Control, Pragma to no-cache for all responses from RESTEasy
<p>I'm trying to add Cache-Control headers to the responses generated in JBoss 7 using the RESTEasy framework. However, all the responses end up getting multiple Cache-Control headers due to JBoss adding a no-cache header by default.</p>

<p>I can't find any setting to remove it and adding interceptors is also not working since a no-cache header is being added later.</p>

<p>Can someone tell me how to disable the default pragma and cache-control headers in JBoss 7?</p>

<p>Note: I'm using resteasy with Stateless EJBs.</p>

<pre><code>@Path("/api")
@Local
public interface UCSRestServiceInterface
{
    @GET
    @Path("/token")
    @Produces("application/json")
    @Cache(maxAge = 3600, noTransform = true)
    public Response getToken();
}
</code></pre>

<p>Getting the response headers as,</p>

<pre><code>{
  "pragma": "No-cache",
  "date": "Thu, 11 Feb 2016 20:16:30 GMT",
  "content-encoding": "gzip",
  "server": "Apache-Coyote/1.1",
  "x-frame-options": "SAMEORIGIN",
  "vary": "Accept-Encoding,User-Agent",
  "content-type": "application/json",
  "cache-control": "no-cache, no-transform, max-age=3600",
  "transfer-encoding": "chunked",
  "connection": "Keep-Alive",
  "keep-alive": "timeout=15, max=100",
  "expires": "Wed, 31 Dec 1969 19:00:00 EST"
}
</code></pre>