This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: A general question
On Monday 18 February 2002 11:38, TP wrote:
> > It would make it browser independent, but I'm not sure it would make it
> > faster (more work being done on the server, so unless you have a very
> > small number of people using your web site or a very beefy server it would
> > actually make it slower).
>
> So, is it not a good idea to parse on the back end if by doing so, we lose
> performance. What do developers generally do? Do they use front-end parsing
> or back-end parsing? I know that there are a few book authors on this list.
> What would you recommend?
It all depends on your requirements. If you don't need browser independence,
then you should stick with MSXML and IE on the client side (unless you are
also worried about the other drawbacks Michael Kay outlined).
If you need browser independence, then there is no way to do it except for
server-side transformation. If you are worried about speed, then you should
still try it, run some benchmarks, and try to optimize your stylesheet
(compile it with XSLTC or experiment with different processors, don't use
'//' axis, or any number of tricks outlined in several threads from
xsl-list). Also experiment with caching the result of the transformation
(ie., only transform on the server once).
If you still have problems with speed, then one trick that has been done
before is to look at the User-Agent header that is sent by the browser. If
it is IE with MSXML, or if your stylesheet can work with Mozilla, then you
can send the XML directly to the client. If it is another browser that
doesn't do client-side transformations, then you can do the transformation on
the server and send the result. Since the majority of browsers are in fact
capable of doing the transformation, this would reduce the load on your
server a lot, while still supporting the older browsers. Exactly how this is
done of course depends on your server-side language and architecture.
--
Peter Davis
Desist from enumerating your fowl prior to their emergence from the shell.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list