How do I set the content encoding of the response to "x-gzip"? I am trying to send HTML data in gzip format, hoping the client will automatically deflate it

Peter Wang

Make sure you set HttpServletResponse by response.setContentType("application/x-gzip" ); A user would have the choice to open with WinZip plugin or save as WinZip file extension to be deflated later on. Very few browsers understand how to deflate this directly and display it.