--Original Message Text---
From: Raymond Camden
Date: Tue, 14 Oct 2003 12:48:13 -0500

> 1) You can speed up the _perceived_ speed of things by using
> cfflush as you display the directory.
>
> I've never used <cfflush> before. Where would that be placed
> in my application. At the end of my directory/file display?

It's used while you display. Let's say you are looping over lots and
lots of crap, you can use cfflush to output the content as it is
generated:

<cfloop index="x" from=1 to=A really, really big number>
<cfoutput>x is #x#<br></cfoutput>
<cfflush>
</cfloop>

OK...I have one part in my application where I'm doing a <cfloop within another <cfloop. Do I require the <cfflush just once before the last </cfloop?

<cfloop...
  <cfloop...
  do crap...
</cfloop>
<CFFLUSH>
</cfloop>

??

There are a few issues with cfflush, see the docs. One thing not
mentioned in the docs is a browser issue. IE will "help" you by not
showing anything until it gets enough content. You can use
<cfoutput>#repeatString(" ",250)#</cfoutput> to force it to display.

OK.

>
> 2) You can cache the results of the directory, or even the
> display, in a persistent variable.
>
> Yikes...do you have any examples?

Sure. Imagine you want to cache the directory of your web root:

<cfif not isDefined("application.webdir")>
<cfdirectory action="" directory="d:\web"
name="application.webdir">
</cfif>
<cfdump var="#application.webdir#">

I see...thanks mon.


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to