[thelist] CF: Building a <body> tag.

.jeff jeff at members.evolt.org
Thu Feb 14 20:53:17 CST 2002


> From: Aaron Johnson
> /articles.cfm would look like
> <cf_formatting>
> Your content here
> </cf_formatting>
> This method promotes encapsulation and reuse, (.jeff
> will argue at the cost of speed, I'd argue that
> encapsulation is more important than millieseconds of
> speed, but that's in the archives)

in the tests i've run, the cost of encapsulation with custom tags is too
high to make it a part of every template's execution.  custom tags are handy
when used for very specialized tasks, but should be avoided whenever
possible.  this is most important when tempted to use custom tags that use a
closing tag.  the penalties for these types are quite large and actually
grow with the size of the generated content between them.


you'll notice that using a custom tag with a closing tag increases the
execution ten-times that of using a cfinclude.  that being said though, this
particular problem isn't one that needs to be solved server-side.  it can
just as easily be solved with javascript and/or css.  therefore, this is a
perfect example of looking at the performance hit of the custom tag and
opting not to go with it as it's clearly not the best solution.



jeff at members.evolt.org

More information about the thelist mailing list