Java Reference
In-Depth Information
Cache JSP fragments, so that dynamic pages could be built once and
retrieved intact.
Products that cache full servlets
Some servlets generate pages that change only every 15 minutes or so. With
supporting software, these can be cached much like static pages. Caucho's
Resin, which has a very fast servlet container, caches servlets and JSP s in this
way. To do so, the page sets up a caching header, which marks the page as
cacheable and sets the appropriate parameters for timeout and the like. BEA
Systems and IBM have similar solutions.
Keep in mind that with these products, you're addressing only the first
and most basic type of JSP caching. You should also consider solutions that
cache dynamic content at various points of the architecture and various levels
of granularity.
Caching JSP fragments
There are many solutions calling for complex user interfaces to compose
dynamic web pages from smaller JSP s called fragments . If a given fragment is
based on a command or similar construct and the command can be cached, it
may make more sense to cache the HTML generated from the compiled and
executed JSP fragment. This practice is known as JSP fragment caching . The
cache is maintained the same way: through the keys generated from the com-
bination of input parameters from the command object. Instead of caching
the output parameters, we cache the executed JSP . IBM has submitted a
request ( JSR 126) to the Java Community Process to propose a uniform
implementation of JSP fragment caching.
Buying a full cache manager
It would require too many pages for us to build all of the previously suggested
enhancements into our example. We should point out that many vendors are
working on robust cache managers for command frameworks similar to this
one. For example, BEA has an alliance with TimesTen, who builds FrontTier, a
dynamic data cache for WebLogic. IBM 's edge server has a cache that stores
dynamic JSP fragments. The capability to cache JSP fragments offers a signifi-
cant performance boost; it eliminates communication and processing by the
web server and web application server layers for a cache hit, even for dynamic
By the time this topic is published, it's likely that most of the major web
application server vendors will have some form of dynamic cache. Still, you
Search WWH ::

Custom Search