[thelist] FrontPage2000 Include Page Component Locking Up....
Madhu Menon
madhu at asiacontent.com
Wed Jul 19 12:46:39 CDT 2000
At 12:00 PM 7/19/00 -0500, you wrote:
>IIS4 caches the ASP page if and only if there is only ASP code in the page.
>The page is *not* cached if there is a mix of ASP and plain HTML. In other
>words, your include file which contains nuthin but functions will get
>cached, but your default page where you have some random response.writes
>here and there will not.
>--Which leads to a good programming practice: Separate code and content.
And therefore, do the following:
1) Make your most commonly used ASP functions into include files. These
will be cached.
2) Instead of scattering multiple Response.Write statements all over the
place like so:
<b>Name: </b> <%=Rs("Name")%>
use:
<%
strHTML = "<b>Name: </b> & Rs("Name")
Response.Write strHTML
%>
In fact, make the HTML content of your web page a variable, and use
Response.Write to spit it out in one shot. It's a lot more efficient than
the start-stop code used above. Moreover, it's all cached.
And Aardarvk wrote:
>in the end, i could get better performance out
>of cleaning up my code (the response.buffer
>stuff, leaner logic, etc.) if i truly needed to,
>and that would easily offset the performance hit
>that the includes carry...
3) While I'm at it, I'll go on to add that while setting
Response.Buffer=True will improve your script performance, making this
change at the server level (if you're on a dedicated server) will improve
performance much more.
4) If you're not using Sessions anywhere in your code, disabling it at the
server level also speeds things up a bit.
5) Use OLEDB instead of ODBC for faster data access.
6) Use the GetRows method of the RecordSet object to get your data and loop
through it. Much faster manipulating arrays than moving through a recordset.
7) Newbie tip: If you use multiple IF statements instead of SELECT CASE,
each statement must be evaluated, regardless of whether the first IF
statement evaluates as true. Why use extra CPU cycles? Use SELECT CASE instead.
Should all that have gone as a tip or was it too basic?
Cheers,
Madhu
<<< * >>>
Madhu Menon
Webmaster, India.CNET.com
http://India.CNET.com
The source for computers and technology
More information about the thelist
mailing list