public void rewrite(BufferedImage image) throws IOException { if (outputter == null) { return; } long time = System.currentTimeMillis(); rewriteImpl(image); time = System.currentTimeMillis() - time; if (minBytes != null && minBytes.length != 0) { StringBuilder rewriteMsg = new StringBuilder(24); rewriteMsg.append("c=").append( ((minBytes.length * 100) / response.getContentLength())); if (!getOutputContentType().equals(getOriginalContentType())) { rewriteMsg.append(";o=").append(getOriginalContentType()); } rewriteMsg.append(";t=").append(time); response.clearAllHeaders() .setHeader("Content-Type", getOutputContentType()) .setHeader("X-Shindig-Rewrite", rewriteMsg.toString()) .setResponse(minBytes); } }
public void rewrite(BufferedImage image) throws IOException { if (outputter == null) { return; } long time = System.currentTimeMillis(); rewriteImpl(image); time = System.currentTimeMillis() - time; if (minBytes != null && minBytes.length != 0) { StringBuilder rewriteMsg = new StringBuilder(24); rewriteMsg.append("c=").append( ((minBytes.length * 100) / response.getContentLength())); if (!getOutputContentType().equals(getOriginalContentType())) { rewriteMsg.append(";o=").append(getOriginalContentType()); } rewriteMsg.append(";t=").append(time); response.clearAllHeaders() .setHeader("Content-Type", getOutputContentType()) .setHeader("X-Shindig-Rewrite", rewriteMsg.toString()) .setResponse(minBytes); } }
public void rewrite(BufferedImage image) throws IOException { if (outputter == null) { return; } long time = System.currentTimeMillis(); rewriteImpl(image); time = System.currentTimeMillis() - time; if (minBytes != null && minBytes.length != 0) { StringBuilder rewriteMsg = new StringBuilder(24); rewriteMsg.append("c=").append( ((minBytes.length * 100) / response.getContentLength())); if (!getOutputContentType().equals(getOriginalContentType())) { rewriteMsg.append(";o=").append(getOriginalContentType()); } rewriteMsg.append(";t=").append(time); // Removing the original 'Etag' header as we have updated the content. response.removeHeader("ETag"); response .setHeader("Content-Type", getOutputContentType()) .setHeader("X-Shindig-Rewrite", rewriteMsg.toString()) .setResponse(minBytes); } }