|
-----Original Message-----
From: Ted R. Rice Sent: Wednesday, May 09, 2001 8:15 AM To: 'Orion-Interest' Subject: RE: Caching XLS style sheets in
actuality, caching pre-compiled stylesheets and then
using
them repeatedly is very possible and you will see
large
performance gains via this mechanism.
in
terms of applying the XSL, the general model is to
create
JSP Pages which produce XML content and
have
this content either be handled by a JSP Tag
Extension, which you place inside the JSP Page,
or
a
Servlet set up as content filter for all XML Content.
The
Servlet method is only available in spec 2.3
However, regardless of the implementation,
caching
can be
performed by static cache shared across all
instances of your object. When a JSP Page
is
processed, you can generate a unique key for
this
page based upon the servletPath(i.e., request.getServletPath())
and
user-Agent header in the request (only applicable if applying
different XSL stylesheets for different browser
agents).
Once
you exctract the appropriate XSL Stylesheet
from
the XML and compile it, you can cache the compiled version
using
the
generated key. In our case what we cache is a
Saxon
TransformManager.
Then,
using the dynamic content generated by the JSP Page, you
can
always look up and apply the pre-compiled style-sheet
for
the unique JSP Page - Browser Agent combination. Please
note,
the
stylesheet is compiled and cached in a lazy manner, meaning
it is
done the first time a request for a particular stylesheet is
made.
This
could easily be retrofitted to build all needed stylesheets
at
startup.
hope
that helps.
Ted
|
- Caching XLS style sheets Vic Cekvenich
- Re: Caching XLS style sheets Tim Endres
- RE: Caching XLS style sheets Jeff Schnitzer
- RE: Caching XLS style sheets Saphari.com - www.saphari.com
- RE: Caching XLS style sheets Jeff Schnitzer
- RE: Caching XLS style sheets Ted R. Rice
- RE: Caching XLS style sheets Jeff Schnitzer
