This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gzip error

 
timothy passcal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code in the servlet for transforming to gzip or not depending on the accept-encoding parameter
<code>
if (supportsGzip == true) {
GZIPOutputStream out = new GZIPOutputStream(res.getOutputStream());
res.setHeader("Content-Encoding", "gzip");
res.setContentType("text/html");
transformer.transform(xmlSource, new StreamResult(out));
out.close();
} else {
ServletOutputStream out = res.getOutputStream();
res.setContentType("text/html");
transformer.transform(xmlSource, new StreamResult(out));
out.close();
}
</code>
In most cases this works perfectly and the performance improvements are tremendous. But every once in a while I get garbled characters on the browser, IE or mozilla both do it.
Anyone come up against this. Would really appreciate it. Gotta roll this out soon.
TP.
 
timothy passcal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any ideas, clues, anyone?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic