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.
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.
Can someone tell me how to disable the default pragma and cache-control headers in JBoss 7?
Note: I'm using resteasy with Stateless EJBs.
@Path("/api")
@Local
public interface UCSRestServiceInterface
{
@GET
@Path("/token")
@Produces("application/json")
@Cache(maxAge = 3600, noTransform = true)
public Response getToken();
}
Getting the response headers as,
{
"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"
}