|
No, that makes sense, Robert (about the challenge of
selecting of keywords) . More on that, and another resource to consider, in a
moment.
But first let me be as clear as Dean wanted to be. I wasn't
knocking you for failing to do google searching in this case. In fact, you'll
note I didn't say anything to that effect in my long note (that you're
responding to). But if you saw my later note (or just other people commenting on
the subject of googling first), you'll see that my comment in that later
note was directed more at myself for not just having googled
first to find Ray's post that said a lot of what I said :-) (though not
all of it). While I did say, "It pays to do a little searching before
writing (as much as before asking).", I meant that only in a broad sense, that
all of us ought to do such searching before asking questions. It wasn't at all
directed at your question.
But while you're right that it can be hard to think of
the right keywords, I wouldn't say you need to "know the language
to search in", if you meant needing to know what CFML tags to look for.
Not at all. I had done just "coldfusion whitespace camden", because I
was looking for Ray's quote. Actually, if you leave off camden, you'll find that
it returns right off the top several (his and others) that are right on target.
So if there's any lesson learned from all this, it's that
we may do ourselves and others a favor by distilling a question
first down to just a couple of keywords and give that a try in Google.
The more all of us do it, the better off we all will be (learning more, and not
drawing too much brain power from the list).
Still, after doing even a few minutes of searching, ask
away.
/charlie
http://www.carehart.org/blog/
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Reil Sent: Friday, August 11, 2006 5:27 PM To: [email protected] Subject: RE: [ACFUG Discuss] White Space In Source Code WOW guys! This is
awesome. I could have googled it
but in the past I have found that my selection of keywords if poor as I don’t
yet know the language to search in. So its just easier with
my insane schedule to just ASK. I was always taught that there is no such thing
as a stupid question except the one not asked... So I
asked. This is all exciting
news as now we have efficient info to study to decide the best
solution. Charlie, Dean, I know
Im a pain on here sometimes but I am really trying to find my way. (or maybe Im
just “trying” your patience.) Either way THANKS TO
ALL! You guys (and gals)
ROCK! Robert P.
Reil Managing
Director, Motorcyclecarbs.com,
Inc. 4292 Office
770-974-8851 Fax
770-974-8852 From: Charlie
Arehart [mailto:[EMAIL PROTECTED] Robert, there are many
solutions, 3 specific tags, 2 tags with related output control, one admin
console setting, a new feature in CFMX 7 that might be helpful, and a couple of
approaches not related to CFML. Pardon the few paragraphs to explain it all, but
each has difference nuances and indeed offers varying levels of suppression and
has slightly varying purpose (which reflect the evolution of CFML over time).
First, there are 3
tags: <cfprocessingdirective
suppresswhitespace="Yes"> ...
do whatever
It's described as
controlling "whether to suppress white space characters within the
cfprocessingdirective block that are generated by CFML tags and often do not
affect HTML appearance. Does not affect any white space in HTML
code.". That's its intent, anyway. I think people
have had varying experience, but I could be
wrong. Note that with
that tag you MUST offer a closing tag--and it has to be in one template,
can't be split with one in the application.cfm, and the closing in the
onrequestend.cfm. :-) Still another tag is
<CFSILENT></CFSILENT>.
It's described as, "Suppresses output produced by CFML within a tag’s
scope. ". Again, this is a paired tag and both must
be in a single template (can't be split
up). An older form
is: <cfsetting
enablecfoutputonly="Yes"> which doesn't require a
closing tag. With it, then the ONLY output generated from the CFML page
(including HTML tags and static text) will be that placed within a CFOUTPUT
statement. Again, even to write out an html tag and/or static text, you'd need
to wrap it (or a big block of it) in a CFOUTPUT. This often confuses people,
either because they forget it's on and wonder, "where's my text"? Or they turn
it on intentionally and forget to wrap static text in it and wonder, "why isn't
this showing up?" Note that if you
want to turn it back on (or off, depending on how you look at it), you use
</cfsetting enablecfoutputonly="no">. And note also that this CAN indeed
be split over multiple files within a request.
Another source of
confusion with these approaches is the question of whether they impact
included files and custom tags. There are differences between them in this
regard, I'm pretty sure, and may be differences in behavior regarding that
between CF and BD, as well as within different versions of each. Again, this
stuff has been evolving over time. Still another way to
control output, in CFCs (CFCOMPONENT) and CFC methods and UDFs (using
CFFUNCTION) is their available OUTPUT attribute. OUTPUT="no/false" can also be
used to prevent any output being generated from the method, at all (again, even
static text). OUTPUT="yes/true" may not be obvious. It indicates that the
body is to act like it's all inside a CFOUTPUT, so you can drop in references to
variables for output and they are evaluated, again, just as if within a CFOUTPUT
tag. If you specify no OUTPUT attribute at all, then things work like any normal
CFML page. Finally, there is also
an Admin console setting to suppress whitespace, which suppresses white space
globally (all apps). Since you can't too easily use CFSILENT and the
CFPROCESSINGDIRECTIVE variant in the application.cfm, it's another way
folks try to achieve suppression. Again, there are nuances, that are worth
exploring before you enable it, and I'll note also differences between CF
and BD in this regard. Oh, a couple last
ideas: if you want to take CFML out of the picture, and just feel that CF pages
in general generate too much white space, you could also consider a Servlet
Filter. They can process page output after the request and could be used to
remove excessive whitespace. It's not trivial to do correctly, but there are
ones out there (from the Java world). I wrote about them in a Feb 2003 CFDJ
article, "Fun with Filters", at http://cfdj.sys-con.com/read/41574.htm. (Actually, that reminds
me that in CFMX 7, you could also do something like that (manually remove
excessive whitespace) in the new application.cfc onrequestend
method.) And last but not least,
as John talked about at the ACFUG meeting, you could also ask the web server to
do gzip compression of all (or some) pages. Note that this does not REMOVE the
whitespace, but it compresses the page so that during transfer from server to
client the penalty of it is lessened. It's worth noting that the whitespace will
still remain in the browser, and while browsers generally ignore it, it still
could impact the speed with which the browser page loads (and possibly other
behavior, since again the whitespace is indeed still
there.) Hope that helps.
/charlie http://www.carehart.org/blog/ From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Is there a way to have
CF output a page with no whitespace in the source
code? Robert P.
Reil Managing
Director, Motorcyclecarbs.com,
Inc. 4292 Office
770-974-8851 Fax
770-974-8852
------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink ------------------------------------------------------------- ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink ------------------------------------------------------------- |
- Re: other resources (Was RE: [ACFUG Discuss] Whit... Dean H. Saxe
- RE: other resources (Was RE: [ACFUG Discuss] ... John Mason
- Re: other resources (Was RE: [ACFUG Discu... Dean H. Saxe
- RE: other resources (Was RE: [ACFUG ... West, Jason
- Re: other resources (Was RE: [ACFUG Discuss] ... Teddy Payne
- Re: other resources (Was RE: [ACFUG Discu... Douglas Knudsen
- Re: other resources (Was RE: [ACFUG ... Teddy Payne
- RE: other resources (Was RE: [ACFUG Discu... Charlie Arehart
- RE: [ACFUG Discuss] White Space In Source Code Robert Reil
- Re: [ACFUG Discuss] White Space In Source Code Dean H. Saxe
- getting help (was RE: [ACFUG Discuss] White Space In ... Charlie Arehart
- RE: [ACFUG Discuss] White Space In Source Code Jared Rapp
- RE: [ACFUG Discuss] White Space In Source Code Dusty Hale
- Re: [ACFUG Discuss] White Space In Source Code Teddy Payne
- RE: [ACFUG Discuss] White Space In Source Code Robert Reil
