Skip to main content
WolfShade
Legend
March 23, 2016
Answered

Frequency of application.cfc/cfm triggered

  • March 23, 2016
  • 2 replies
  • 708 views

Hello, all,

Y'know.. in all the years that I've been coding in CFML, it never once occurred to me to ask the following question, but here it is..

If I have a page as such:

<!DOCTYPE html>

<html>

  <head><title>Unknown Comic</title></head>

  <cfinclude url="menu.cfm"/>

  blah blah blah - foo bar

  <cfinclude url="footer.cfm" />

</html>

Does the application.cfc trigger only once (for the document, itself)?  Or does it trigger once for the document, then once for each include (total of three times for above example)?

V/r,

^_^

(Forgive the n00b question - it just never came to mind until now.)

    This topic has been closed for replies.
    Correct answer nic_tunney

    URL attribute aside, the cfincludes pull the content "into" the existing .cfm page, so the appropriate Application.cfc methods would be called only once.  This is still considered one request.

    2 replies

    nic_tunneyCorrect answer
    Inspiring
    March 24, 2016

    URL attribute aside, the cfincludes pull the content "into" the existing .cfm page, so the appropriate Application.cfc methods would be called only once.  This is still considered one request.

    WolfShade
    WolfShadeAuthor
    Legend
    March 24, 2016

    Thanks, @nic_tunney.  I couldn't shake that feeling that it was being triggered for each include.

    V/r,

    ^_^

    EddieLotter
    Inspiring
    March 23, 2016

    The cfinclude tag does not currently have a "url" attribute. It does not make another request to the server and thus does not involve application.cfc

    Cheers

    Eddie