gzip cfm pages

75 views
Skip to first unread message

Scott Conklin

unread,
Feb 3, 2011, 11:02:49 AM2/3/11
to framework-one
not sure if this issue is directly related to fw/1 one or not, but it
sure is strange. when turning on a gzip filter (http://
www.servletsuite.com/servlets/gzipflt.htm) running on my coldfusion
server i seem to get problems intermittently.

Clicking on the links of my site seems to serve the content just fine
(normal 200 responses) with the content properly gzipped.

Content-Encoding:gzip
Content-Length:2499
Content-Type:text/html; charset=UTF-8
Date:Thu, 03 Feb 2011 15:48:12 GMT
Server:Microsoft-IIS/7.5
X-Powered-By:ASP.NET
X-UA-Compatible:IE=Edge,chrome=1

However, when i execute a controller action that either use
variables.fw.redirect or performs a post like authenticating a user
from a login page, it just stops processing. in the last example it
just complains that the arguments passed into my service function are
missing:

The PASSWORD parameter to the authenticateuser function is required
but was not passed in.

where the call from the controller to the authenticateuser method
looks like this:

function dologin(rc){
var result =
getUserService().authenticateuser(argumentCollection=rc);
....

Dumping out the rc struct just prior to the getUserService() call
shows that the fields are indeed there.
when i turn off the gzip filter, everything works just fine... forms
and redirects process as expected.

i am running cf 9.0 on windows 7 IIS 7.5.

Does anyone have any idea what this could be?

Sean Corfield

unread,
Feb 3, 2011, 2:26:03 PM2/3/11
to framew...@googlegroups.com
Do you see this with specific browsers or all browsers?

(It really can't be a FW/1 issue since the compression all happens
between the browser and IIS - ColdFusion / FW/1 aren't even aware of
it)

Scott Conklin

unread,
Feb 3, 2011, 6:52:16 PM2/3/11
to framew...@googlegroups.com
i went a different route and got it working..

thanks

Jamie Krug

unread,
Feb 3, 2011, 8:41:11 PM2/3/11
to framework-one
On Feb 3, 6:52 pm, Scott Conklin <socra...@sconklin.com> wrote:
> i went a different route and got it working..

Care to share? I'm just curious. It strikes me as odd that there's a
Java servlet filter to handle gzip compression, but maybe this is
intended for a stack leveraging the Java app server's built in Web
server capability? Otherwise, it feels a bit cleaner to handle this
type of thing at the Web server level. I know Apache configuration is
fairly simple and flexible. I'd have to imagine IIS has some support
for this as well. Anyway, peaked my interest, so curious to hear if
you identified the problem and how you "got it working" ;-)

Best,
Jamie

Sean Corfield

unread,
Feb 4, 2011, 3:08:41 AM2/4/11
to framew...@googlegroups.com
On Thu, Feb 3, 2011 at 5:41 PM, Jamie Krug <jami...@gmail.com> wrote:
> Anyway, peaked my interest

...piqued my interest

(sorry)
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Scott Conklin

unread,
Feb 4, 2011, 10:37:41 AM2/4/11
to framework-one
@Jamie

I actually spent days experimenting with different approaches to get
this working. I stumbled across the gzip filter that i mention above
only after failing to get "dynamic content" gzipped in IIS 7.0/7.5.
I understand this is easy in Apache but in IIS I had no luck getting
this to work after following several blogs on the matter. I believe i
was told that IIS considers dynamic content to be only .asp, aspx,
and .php files, but i can't remember now where i read that. Also,
unlike iis 6.0 , apparently you no longer specify a suffix but rather
just the mime types.. in any event, several trials failed to get it
working for me. if anyone knows how to get IIS 7.5 to gzip .cfm pages
through the web.config file them please let me know.

I am, btw, gzipping static content (css and js) through the
webserver. this was easy and is in fact the default setting in IIS
7.0

I then tried using the gzip filter (http://www.servletsuite.com/
servlets/gzipflt.htm) that i found but was not that crazy about using
it as 1) it requires me to modify the CF web.xml file by adding the
filter mapping and 2) it was quite an old technology.. i believe the
page was published in 2003. Moreover, when i discovered that on
certain pages that processing would just simply die then this was of
course a show stopper. BTW: this problem was completely unrelated to
FW/1 as the problem showed itself on logging into CF administrator.
pages painted fine, but logging in (posting from a form i am guessing)
just died. viewing the source showed just a blank screen.

I then decided to take a cfml approach after finding this article on
Ben Nadels website:
http://www.bennadel.com/index.cfm/blog/712-Using-ColdFusion-s-CFLocation-Tag-For-Inline-Image-SRC-Attributes.htm
where the poster talks about gzipping as sidenote. this approach uses
the java.util.zip.GZIPOutputStream java object.

to get this to work in FW/1, i had to take a bit of an unorthodox
approach and "delay" the output stream for intervention. I did NO
touch the framework , but i did override the onRequest method which i
know i am not supposed to do. Below are the 2 relevant snippets from
my application.cfc. (I welcome feedback on this approach)
(Note: i believe this solution is working for me in call cases and
appears to be running fast. I have tested my app thoroughly and
firebug and fiddler are now showing that ALL my content is being
delivered gzipped and my YSLOW score is now up to 96 which was my
original motivation for starting in on this treacherous task in the
first place)

-------
variables.strHTML = '';
...
function onRequest(targetPath) {
savecontent variable="strHTML" {
super.onRequest(targetPath);
};

}
function onRequestend() {
if (cgi.HTTP_ACCEPT_ENCODING contains "gzip") {
// use captured strHTML stream and gzip it
boStream = createobject("java",
"java.io.ByteArrayOutputStream").init();
gzOutput =
createobject("java","java.util.zip.GZIPOutputStream").init(boStream);
gzOutput.write(strHTML.getBytes("utf-8"), 0,
len(strHTML.getBytes("utf-8")));
gzOutput.finish();
gzOutput.close();
boStream.flush();
boStream.close();
// convert to binary
outstr = boStream.toByteArray();
// set gzip headers
$header('Content-Encoding', 'gzip');
$header('Content-Length', '#ArrayLen(outstr)#');
// output binary data using cfcontent with reset=yes
$content(outstr);
}
else
writeOutput( strHTML );

}

On Feb 4, 2:08 am, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Thu, Feb 3, 2011 at 5:41 PM, Jamie Krug <jamiek...@gmail.com> wrote:
> > Anyway, peaked my interest
>
> ...piqued my interest
>
> (sorry)
> --
> Sean A Corfield -- (904) 302-SEAN
> Railo Technologies, Inc. --http://getrailo.com/
> An Architect's View --http://corfield.org/

Jamie Krug

unread,
Feb 4, 2011, 11:13:38 AM2/4/11
to framew...@googlegroups.com
On Fri, Feb 4, 2011 at 3:08 AM, Sean Corfield <seanco...@gmail.com> wrote:
On Thu, Feb 3, 2011 at 5:41 PM, Jamie Krug <jami...@gmail.com> wrote:
> Anyway, peaked my interest

...piqued my interest

(sorry)

Give me a break, Sean, their are plenty of people making such mistakes, even when there smart developers. Its just easy to miss wierd little grammatical quirks if your quickly typing a response. I wonder if, in you're responses, you've ever made such a mistake. Than again, the truth is, its easy to loose sight of the importance of proofreading your e-mails. Speed has it's benefits, but accuracy is also important. Many developers are quite detailed about there code style, yet play it lose when it comes to e-mail grammar. Weather or not that's a good idea is questionable. I believe it can have a negative affect on discussions. It may even effect your response to a given thread. Proofreading may be more important then we think. I, for one, will make it a point to continually improve, and I hope alot of other folks on this fine FW/1 list will do the same!

Okay, in all honesty, thank you. I should know better, but I must admit that I I've probably slipped on this "peaked" versus "piqued" one before :P

OT: For a fun quiz, see if you can spot all of the errors I've crammed into my first paragraph--the rambling assault on the English language, above. I count 16 ;-) Technically, there are 14 instances of word misuse and two spelling errors.

Cheers,
Jamie

Jamie Krug

unread,
Feb 4, 2011, 11:20:50 AM2/4/11
to framew...@googlegroups.com
Scott,

Interesting stuff! Thanks for sharing the experience. Your use of java.util.zip.GZIPOutputStream at onRequestEnd() seems a sensible solution to me. Depending upon which CFML engine you're using and which connector you're using for IIS, I could see challenges to using IIS compression tooling. I'd imagine a proxy configuration in Apache might provide a bit more flexibility for compressing content returned from a proxy to your Java app server (i.e., CFML). IIS may very well have that flexibility as well, but it's not something I've tackled.

Best,
Jamie

spills

unread,
Feb 4, 2011, 12:05:47 PM2/4/11
to framework-one
> Interesting stuff! Thanks for sharing the experience. Your use of
> java.util.zip.GZIPOutputStream at onRequestEnd() seems a sensible solution
> to me. Depending upon which CFML engine you're using and which connector
> you're using for IIS, I could see challenges to using IIS compression
> tooling. I'd imagine a proxy configuration in Apache might provide a bit
> more flexibility for compressing content returned from a proxy to your Java
> app server (i.e., CFML). IIS may very well have that flexibility as well,
> but it's not something I've tackled.

I've been playing with IIS Application Request Routing along with IIS
URL Rewrite on a dev server for a couple of weeks now and it allows
you to avoid using any connectors to IIS as IIS will "hand off" the
incoming request based on whatever pattern you have setup. I have
found that this allows you to still manage SSL with IIS but allows you
much more flexibility with your Java app server. I am still working
with it but, so far I am encouraged with how it is working in the dev
environment.

Brian Meloche

unread,
Feb 4, 2011, 12:31:47 PM2/4/11
to framew...@googlegroups.com
Give me a break, Sean, their are plenty of people making such mistakes, even when there smart developers. Its just easy to miss wierd little grammatical quirks if your quickly typing a response. I wonder if, in you're responses, you've ever made such a mistake. Than again, the truth is, its easy to loose sight of the importance of proofreading your e-mails. Speed has it's benefits, but accuracy is also important. Many developers are quite detailed about there code style, yet play it lose when it comes to e-mail grammar. Weather or not that's a good idea is questionable. I believe it can have a negative affect on discussions. It may even effect your response to a given thread. Proofreading may be more important then we think. I, for one, will make it a point to continually improve, and I hope alot of other folks on this fine FW/1 list will do the same!
  1. There instead of their.
  2. They're instead of there.
  3. It's instead of its.
  4. Weird instead of wierd.
  5. You're instead of you're.
  6. Your instead of you're.
  7. Then instead of than.
  8. It's instead of its.
  9. Lose instead of loose.
  10. Its instead of it's.
  11. Their instead of there.
  12. Loose instead of lose.
  13. Whether instead of weather.
  14. Effect instead of affect.
  15. Affect instead of effect.
  16. A lot instead of alot.
That's 16... did I miss any? :-)

Sincerely,

Brian Meloche,
brianmeloche at gmail dot com
Podcast: cfconversations.com
Blog: brianmeloche.com
Twitter: @coofuushun
Manager, Cleveland CFUG, clevelandcfug.com
Creator, LightFront: http://lightfront.riaforge.org



--

Brian Meloche

unread,
Feb 4, 2011, 12:33:59 PM2/4/11
to framew...@googlegroups.com
5) should be you're instead of your. :-)

Scott Conklin

unread,
Feb 4, 2011, 12:42:00 PM2/4/11
to framew...@googlegroups.com
i have url rewrite rules for SES implemented in IIS as well, i would be
interested to hear more about your
experiences with Request Routing when you are done. Does this mean you
are allowing the java app server to handle gzipping?

spills

unread,
Feb 4, 2011, 12:59:46 PM2/4/11
to framework-one
On Feb 4, 11:42 am, Scott Conklin <socra...@sconklin.com> wrote:
> i have url rewrite rules for SES implemented in IIS as well,  i would be
> interested to hear more about your
> experiences with Request Routing when you are done. Does this mean you
> are allowing the java app server to handle gzipping?
>
Yep, I am no server admin guru but it seems to be working nice here
are some links I came across that got me pointed in this direction.

http://www.iisadmin.co.uk/?p=326&page=3
http://aegissecurityworks.blogspot.com/2009/11/iis-7-as-web-front-end-to-systinet-uddi.html
http://blogs.iis.net/eokim/archive/2010/03/09/arr-with-tomcat.aspx
http://forums.iis.net/1152.aspx

Scott Conklin

unread,
Feb 4, 2011, 1:37:46 PM2/4/11
to framew...@googlegroups.com
thanks for those links.
I guess this means you are deploying coldfusion over Tomcat? i should
have mentioned that i have coldfusion 9 standalone (uses JRUN) and the
installation process does all the connectors for you.

Did you just download cf as war file and drop it into the webapps folder?

if you are doing this, then why not just use apache as your webserver
and just use mod_proxy to proxy the requests and leave IIS out? isn't
this more straightforward?

Tomcat + apache + Ralio or CF as WAR file seems to be a common
configuration on linux boxes

(i have this configuration on my ubuntu box)

spills

unread,
Feb 4, 2011, 1:44:23 PM2/4/11
to framework-one
> Tomcat + apache + Ralio or CF as WAR file seems to be a common
> configuration on linux boxes
>

Actually playing with IIS + Railo + Jetty;

I actually prefer IIS 7.5 over Apache just because I have used it the
most and like the management tools and with ARR on IIS you are simply
handing the request over to the Java App server so really not any
significant overhead.

Dave Anderson

unread,
Feb 4, 2011, 3:12:35 PM2/4/11
to framew...@googlegroups.com
Don't apologize!

I corrected a cousin the other day on Facebook for some your/you're confusion, and she replied that she wasn't proofreading, and had simply copy&pasted.  "Oh, I see," I said, "it's the old 'it's not that I don't understand elementary English, it's just that I'm lazy' excuse.  I should try that."  I figured she'd be offended, though that was not my intent, but instead she replied thoughtfully that she felt she ought to be less lazy.  Clear written communication is indicative of clear thought, and no native English speaker older than 10 should confuse your with you're.

Peaked/piqued, on the other hand, is not the same kind of error as your/you're.  The latter can be attributable to hasty typing, and can sometimes seem dickish to correct (though it's hard to resist), while the former more likely indicates a harmless ignorance.  If I thought the term was 'peaked my interest' and didn't know it was actually 'piqued', I'd appreciate the correction.  If I accidentally typed 'to' instead of 'too' in an IM, I'd be significantly less grateful.

If my grammar should ever require a correction, please feel free to do so without an apology.

Dave

Dave Anderson

unread,
Feb 4, 2011, 3:14:15 PM2/4/11
to framew...@googlegroups.com
I enjoyed that.  Thanks for the effort.

larryclyons

unread,
Feb 4, 2011, 3:16:33 PM2/4/11
to framework-one
ASAAAGGGGHHHH!!!!!!

Grammar Germanic Right Wing Extremist Political Party Members!

(There I could say Grammar N*z*s without Godwining the conversation)

On Feb 4, 12:31 pm, Brian Meloche <brianmelo...@gmail.com> wrote:
> Give me a break, Sean, their are plenty of people making such mistakes, even
> when there smart developers. Its just easy to miss wierd little grammatical
> quirks if your quickly typing a response. I wonder if, in you're responses,
> you've ever made such a mistake. Than again, the truth is, its easy to
> loosesight of the importance of proofreading your e-mails. Speed has
> it's benefits, but accuracy is also important. Many developers are quite
> detailed about there code style, yet play it lose when it comes to e-mail
> grammar. Weather or not that's a good idea is questionable. I believe it can
> have a negative affect on discussions. It may even effect your response to a
> given thread. Proofreading may be more important then we think. I, for one,
> will make it a point to continually improve, and I hope alot of other folks
> on this fine FW/1 list will do the same!
>
>    1. There instead of their.
>    2. They're instead of there.
>    3. It's instead of its.
>    4. Weird instead of wierd.
>    5. You're instead of you're.
>    6. Your instead of you're.
>    7. Then instead of than.
>    8. It's instead of its.
>    9. Lose instead of loose.
>    10. Its instead of it's.
>    11. Their instead of there.
>    12. Loose instead of lose.
>    13. Whether instead of weather.
>    14. Effect instead of affect.
>    15. Affect instead of effect.
>    16. A lot instead of alot.

Jamie Krug

unread,
Feb 4, 2011, 3:43:27 PM2/4/11
to framew...@googlegroups.com
On Fri, Feb 4, 2011 at 12:05 PM, spills <spill...@yahoo.com> wrote:
I've been playing with IIS Application Request Routing along with IIS
URL Rewrite on a dev server for a couple of weeks now and it allows
you to avoid using any connectors to IIS as IIS will "hand off" the
incoming request based on whatever pattern you have setup. I have
found that this allows you to still manage SSL with IIS but allows you
much more flexibility with your Java app server.

Cool. This sounds very similar to basic Apache proxy behavior.

Jamie Krug

unread,
Feb 4, 2011, 3:48:37 PM2/4/11
to framew...@googlegroups.com
Yup, you've aced my grammar quiz, Brian. Thanks for playing :)

Sean Corfield

unread,
Feb 4, 2011, 6:03:16 PM2/4/11
to framew...@googlegroups.com
On Fri, Feb 4, 2011 at 12:12 PM, Dave Anderson
<the.one.true....@gmail.com> wrote:
> Peaked/piqued, on the other hand, is not the same kind of error as
> your/you're.

One I've seen quite a few times recently from various authors is
"...for all intensive purposes..." (it's "for all intents and
purposes"). I'm not sure why that's suddenly become more common. I can
mostly ignore your/you're, they're/there/their, to/too/two (although
they annoy the crap out of me - guess the offenders are really alive
:) but one that really, really gets my goat is mixing up infer/imply -
because that tends to come up in more argumentative threads when I'm
already looking to smack someone down :D :D :D

> If my grammar should ever require a correction, please feel free to do so
> without an apology.

Heh, I'll take that under advisement...

The apology is generally because I'm British and we say "sorry" about
everything, including when we're trying to get someone to pass the
salt (John Cleese reference for any fans out there).

The grammar corrections come from a fairly austere and very strict
upbringing at Collyer's Grammar School (yes, really)... You've seen
the Harry Potter movies? Hogwarts was pretty much my school... large
dining hall, masters on benches on the stage, boys eating at long
benches down the length of the hall, four 'houses', based on your
academic vs sporting abilities... I was in Collyer's (light blue -
academic), and we had Hurst (red), St Leonard's (green) and Mercer's
(Oxford blue but I remember their color as black - sports). We all
called each other by our surnames - unless you got to know another boy
really well (oh, it was an all boys school) - and all the staff were
"Sir!". And, yes, we had prefects and they could put you in detention
or give you lines or essays as punishments (a two page essay on "the
sex life of the inside of a ping pong ball" was a common one). The old
school building had stone spiral staircases, high vaulted ceilings and
big flagstone quadrangles in between the old red brick buildings.
Strict uniform code (with ties) too.

Scarred for life, I am... :)

Mike Rankin

unread,
Feb 5, 2011, 5:00:50 PM2/5/11
to framew...@googlegroups.com
The thought that people think Nazi's are "right wing" when a solid argument can be made that they are leftists* bothers me more than any of the grammatical errors mentioned in this discussion.  Generally speaking, the right advocates for the decentralization of power.  For good or ill, most people recognize de-regulation of industry, advocating states rights, reducing taxes, eliminating social programs and privatizing entitlements as right wing.  You won't find any of that in the Nazi Party platform.

On the other hand, making the gov't responsible for providing jobs, nationalization of industry, public education, regulation of the media, all to be made possible by a strong central authority, is in there.

While it's ridiculous to equate the US left (ie, Democrats) with the Nazi party, it's at least as ridiculous to suggest that the US right (Republicans) are Nazis. 

Judith Barnett

unread,
Feb 5, 2011, 5:17:12 PM2/5/11
to framew...@googlegroups.com
My son wrote a 180,000 word novel and send to me to proofread. Almost
every homophone in it was wrong.

Using loose for lose sets my hair on fire from some reason.

Sean Corfield

unread,
Feb 5, 2011, 6:23:46 PM2/5/11
to framew...@googlegroups.com
On Sat, Feb 5, 2011 at 2:00 PM, Mike Rankin <anody...@gmail.com> wrote:
> While it's ridiculous to equate the US left (ie, Democrats) with the Nazi
> party, it's at least as ridiculous to suggest that the US right
> (Republicans) are Nazis.

At the risk of going even further OT than we already are (and if there
were a fw1-community list, this thread would have gone there a long
time ago)...

Something that is obvious to most Europeans but few Americans: America
really has two right-wing parties - one is just more moderate than the
other - and both parties have changed their positions on a number of
key policies over the last half dozen decades which confuses the issue
even more. Europe has a much more broad mixture all across the
spectrum - with extremes on both ends that make America look
positively centrist at times.

But let's get back to technical discussions about frameworks. Please.

Dave Anderson

unread,
Feb 5, 2011, 11:25:25 PM2/5/11
to framew...@googlegroups.com
That school experience, however strict and seemingly homogeneous, sounds thoroughly excellent for a variety of reasons, the most important of which is that an essay about "the sex life of the inside of a ping-pong ball" is a punishment that could only be devised by someone who encourages creativity and free-thinking.

Dave Anderson

unread,
Feb 5, 2011, 11:27:14 PM2/5/11
to framew...@googlegroups.com
Good Lord!  What is that -- about 700 pages?

larryclyons

unread,
Feb 6, 2011, 4:44:23 PM2/6/11
to framework-one
Mike,

If you want to have a discussion on such right wing myths, take it
elsewhere. This list is specifically for fw/1
> * the National Socialist German Workers Party Platform<http://users.stlcc.edu/rkalfus/PDFs/026.pdf>
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages