I am using the mozilla firebug extension to see the request and response headers . The request headers has a field accept encoding which has gzip in it . However in the respone headers I have no Content-encoding field present . I have cleared the cache completely .
Can anyone help me on how I can make Tomcat to gzip the content before sending the content to the browser?
I have used Page insight as well and it asks me to compress the content .
You have to set the content-type headers yourself. Tomcat cannot deduce what they should be, not least because not only do so many content types look alike, but because in some cases, such as Microsoft Excel spreadsheets, there's more than one "standard" content-type defined.
Tomcat will read the content-type header as the response as sent and use that to determine whether to compress the datastream or not. Or, if you want to be more accurate, the Valve that you configured will.