Skip to main content
WolfShade
Legend
Mar 23, 2016 8:28 PM UTC
Answered

Frequency of application.cfc/cfm triggered

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 is closed to new replies. Start a new post to keep the conversation going.
    nic_tunneyCorrect answer
    Inspiring
    Mar 24, 2016 2:06 AM UTC

    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.

    7 replies

    nic_tunneyCorrect answer
    Inspiring
    Mar 24, 2016 2:06 AM UTC

    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.

    Translate
    WolfShade
    WolfShadeAuthor
    Legend
    Mar 24, 2016 12:55 PM UTC

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

    V/r,

    ^_^

    Translate
    EddieLotter
    Inspiring
    Mar 23, 2016 9:29 PM UTC

    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

    Translate