At 09:56 AM 11/9/01 -0500, Su Zhang wrote:
>Hi,
>
>    Since <psp:insert> does not parse the inserted file for psp content, does
>it mean that <psp:insert> has better performance than <psp:include>? If the
>inserted/included file is a plain text file or a html file, which one should
>be used?
>
>Su

 From my reading of the docs, there are actually 4 options:

1.  <%@ include file="myfile.txt"%>
includes another PSP file as though it were part of the original PSP file

2.  <psp:include path="myfile.html" >
include output from another servlet (which could be an html file or any 
other servlet) using forwardRequestFast()

3.  <psp:insert file="myfile.html" >
read in myfile.html on every request and insert it into the output, without 
parsing for PSP content

4.  <psp:insert file="myfile.html" static="true" >
read in myfile.html at servlet generation time and insert it into the 
generated PSP file verbatim, without parsing for PSP content

You might want to try all four options and see which ones you prefer.  If 
the included files are large and used in many different places, you may 
want to go with option 2 or 3 since the contents of the included file won't 
be included into the code of every PSP page that uses them.  Options 2 and 
3 also have the advantage that when the file changes on disk, you 
automatically get the latest version without having to restart the 
appserver.  I think option 2 may be faster than option 3 due to caching but 
I'm not positive.

On the other hand, you might find that options 1 and 4 are faster than 2 or 
3, but less convenient because they will require restarting the appserver 
every time you change the include files.  Option 4 will probably compile 
faster than option 1, but obviously won't allow use of PSP tags.

Basically, try them out and see if you notice any difference.  I'm sure 
they're all fast enough for most applications.


--

- Geoff Talvola
   [EMAIL PROTECTED]

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to