Ok I thought I was onto a beginning here
by getting coldfusion to compress the content, and then redisplay it. In its
basic form this will only do text at this stage, but it is a start. Anyway I hit a snag, I can not for the
life of me get the browser to deflate the string. Anyone see the problem at
all, I have tried many combinations of the cfcontent and cfheader but not the
right one by the looks of it.
<cffunction name="onRequestEnd" returntype="boolean"
output="true">
<cfargument name="thePage" type="string"
required="true">
<cfset var myString ="Andrew was here in 2006" />
<cfset var fileOut = '' />
<cfset var out = '' />
<cfscript>
pageOut = getPageContext().getCFOutput().getString();
</cfscript>
<cfscript>
fileOut = createobject("java", "java.io.ByteArrayOutputStream").init();
out = createobject("java","java.util.zip.GZIPOutputStream").init(fileOut);
// Complete the GZIP file
out.finish();
out.close();
</cfscript>
<cfheader name="Content-Length"
value="#fileOut.toString().length()#">
<cfcontent type="text/html; charset=UTF-8" reset="yes">
<cfheader name="Content-Encoding" value="gzip">
<cfoutput>#fileOut.toString()#</cfoutput>
</cffunction> Senior Coldfusion Developer Aegeon Pty. Ltd. Phone: +613 8676 4223 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~--- |
- [cfaussie] Compressing the output to the browser via CF Andrew Scott
- [cfaussie] Re: Compressing the output to the browser via... Mark Mandel
- [cfaussie] Re: Compressing the output to the browser... Andrew Scott
- [cfaussie] Re: Compressing the output to the bro... Mark Mandel
- [cfaussie] Re: Compressing the output to the... Andrew Scott
- [cfaussie] Re: Compressing the output t... Dale Fraser
- [cfaussie] Re: Compressing the outp... Andrew Scott
- [cfaussie] Re: Compressing the ... Dale Fraser
- [cfaussie] Re: Compressing the ... Mark Mandel
- [cfaussie] Re: Compressing the ... Andrew Scott
- [cfaussie] Re: Compressing the ... Mark Mandel