SSI vs. Function Call...does no one know?

Results 1 to 7 of 7

Thread: SSI vs. Function Call...does no one know?

  1. #1
    Peter S. Guest

    Default SSI vs. Function Call...does no one know?

    Which is faster? Doing a Server Side Include for a file or creating a fuction that creates the contents of that file through a function call? The reason I ask is that this could be temporary solution to dynamic SSI&#039s, although it involves a lot of menial typing work. But if function calls have performance improvements over SSI&#039s than why not? Anyway does anyone know?

  2. #2
    SPG Guest

    Default RE: SSI vs. Function Call...does no one know?

    If I understand what you&#039re asking ("Is it faster to nail some file content with an #include or by using an FSO to rip open the file and tear it&#039s beating heart out?"), the answer is clearly "Use the #include!". [There&#039s a big exception to this, see below]<BR><BR>This is absolutely required for importing & recycling functions (prior to IIS 5).<BR><BR>[Exception:]<BR>Using the FSO to get file content is much slower than an #include call -- but it does give you flexibility as to what you want to include and when. An include is absolutely processed whether you needed it or not -- so if a user *might* come in and *might* want the content for any of 50 different articles, you should definitely open the articles with an FSO-wielding function instead of using 50 #includes.<BR><BR>There are some articles around here somewhere, but I&#039ve not seen/read them in a long time.<BR><BR>Hope it helps.

  3. #3
    Ian Stallings Guest

    Default RE: SSI vs. Function Call...does no one know?

    I think there might be some confusion. You can<BR>include files based on logic like so:<BR><BR><BR>strUser = Request("User")<BR><BR>select case strUser<BR>case "coolGuy1"<BR>&#060;!--#include file="dude1.asp"--&#062;<BR>case "coolGuy2"<BR>&#060;!--#include file="dude2.asp"--&#062;<BR>case "coolGuy3"<BR>&#060;!--#include file="dude3.asp"--&#062;<BR>end select<BR><BR><BR>But you cannot do this:<BR><BR>&#060;!--include file="&#060;%variableName%&#062;"--&#062;<BR><BR>If you know the names of the files you are golden. If they<BR>are generated dynamically then you would want to use the FSO<BR>to open the file.<BR><BR><BR>I hope this helps :-)

  4. #4
    Peter S. Guest

    Default Actually...I meant something different...please re

    Hey thanks for the reply. Actually I read about doing the FSO method and that&#039s not really what I had in mind. I tried it and the problem with doing FSO is that you can&#039t use any FSO in the page your going to rip out and display on the browser. <BR><BR>What I was aiming towards was if I rewrote the whole page as a function call literally. I mean make a function like<BR><BR>function writewebpage()<BR> ...<BR>end sub <BR><BR>and then from the main page in a <BR>Select case<BR>case "1"<BR> call writewebpage()<BR>etc...<BR><BR>which will actually write out the function which will be one massive response.write command.<BR><BR>for example response.write(line1 & line2 & ...)<BR><BR>Now I know again that this takes a lot of time to do but heck it will give me that flexibility and will also give me the the asp coding I need to put on the pages I am creating.<BR><BR>So is doing a pure function call as above faster/slower? than doing a Server Side Include call? <BR><BR><BR>One other thing is that I worry that if I put like several of these massive function call, each function representing a page or multiple pages if I decide to stick all in one, will the load/compilation time for asp that much longer? <BR><BR>In my present situation, I have many SSI files in one main page arranged in a select case statement. Now as I understand it all of these SSI&#039s gets preloaded and written before the ASP takes over. Loading and sticking all these extra files gets cumbersome because it takes extra server processing time and makes the overall web site slower, from what I can tell. So can anyone suggest a method to my problem a fix? <BR><BR>Also please answer if SSI call is faster/slower than function call..<BR><BR>thanks...

  5. #5
    Peter S. Guest

    Default Oops sorry, I meant ASP in the body of the text ab


  6. #6
    Ian Stallings Guest

    Default RE: Actually...I meant something different...pleas

    Use SSI. It&#039s quicker for the web server to display static<BR>text as opposed to writing it using response.write<BR><BR>If this is not what you mean then I am really confused.<BR>Does this help?

  7. #7
    Peter S. Guest

    Default thanks..

    Yes partially. Thanks :) It still doesn&#039t solve my problem with having so many SSI calls on my page, even if it is in a Select Case statement. All those SSI statements still gets preloaded and bogs down the speed at which my web server processes or reacts. I guess I&#039ll just have to wait for my web host to upgrade their IIS to 5.0 and raise their asp to 3.0, so that I can use the response.execute command. Thanks again...

Posting Permissions

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