includes inside of includes

Results 1 to 2 of 2

Thread: includes inside of includes

  1. #1
    Join Date
    Dec 1969

    Default includes inside of includes

    in classic asp, is it generally a bad hit to server speed to have includes inside if other includes?<BR><BR>thanks,<BR><BR>corey

  2. #2
    Join Date
    Dec 1969

    Default Understanding includes...

    The #includes are all processed in the ASP engine (or even in IIS? since it supports server side includes? I think so) by the simple process of creating an in-memory buffer where all the lines in the main file are read in up to the point of the #include. Then all the lines of the #include file are put into the buffer. Then more lines from the main file. Etc.<BR><BR>In other words, the engine does the same thing you could do yourself by using COPY/PASTE to create a version of the page where the contents of the #include&#039;s replace the #include lines.<BR><BR>Then this conglomerated buffer is passed to the language engine (e.g., VBScript). So the language engine NEVER SEES the #includes. And then the language compiles the monster conglomeration into an internal byte code form.<BR><BR>And *IF* the page in question stays "hot" (that is, it is "hit" by users often enough), then it is that internal byte code form that is cached by the ASP engine. For as long as it stays hot.<BR><BR>If the page does not stay hot, then indeed the byte code is tossed out and, the next time the page is finally needed, then all the #include&#039;s have to be re-conglomerated and everything has to be compiled again.<BR><BR>Okay, so if the page is hot, there is ZERO penalty for using #include&#039;s compared to not doing so, right?<BR><BR>And if the page is *NOT* hot... Well maybe it takes a few milliseconds longer to rebuild the compiled code. But who cares? What&#039;s a few milliseconds every hour or so?<BR><BR>In short: It don&#039;t matter one little bit.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts