EasyCFM.COM ColdFusion Forums / Good Coding Tips! / cfinclude

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: cfinclude

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Shalinko
02-16-2010 @ 4:01 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

Hi, I'm just getting back into cf after a couple years break. Wanna restart a project which uses maybe 5 or 6 incudes per page. Did a search but can't find any info on if they slow down your site (someone assured me they do, and templates are better). Also seem to get a lotta whitespace....is that due to includes? Thanks.

Webmaster
02-16-2010 @ 6:01 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Well, this really is based off of your included code. The overhead for an include in comparison to a custom tag or using objects is about the same (if not a little more) but should be minimal.

The biggest drawback is encapsulation of variables.. so includes have access to the same scopes are your main template so it could over write variables, etc.

By using objects or custom tags you can "control" what variables you pass in and it will work in all cases with more power... but it's all about what you are trying to do... make sense?

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---

Shalinko
02-17-2010 @ 6:43 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Sep 2007

Yeah, makes perfect sense thanks. Got used to looking out for variables in the includes etc. but was just surprised at how strongly this guy argued against using includes. I do have a question about how they might effect the site map though, I can't get one working in DW. Maybe I shold post a new topic?
Thanks a mil.


Website Designed and Developed by Pablo Varando.