We recently put into production the OSCache Servlet Filter.
The requests still get processed by Tomcat but if the cache is hit
the Filter directly returns the content from either a Memory and/or
Disk Cache. We made some significant improvements to the ServletFilter
and contributed the code back to them. They said they would commit the
code to CVS but I don't know if they have yet. We saw a big reduction
in request latency when the cache is hit and a great deal less load
on Tomcat.
What is really nice is that it can cache not only based on the URL,
but also can maintain a different cached version of a page based
on GET or POST request parameters.
http://www.opensymphony.com:8668/space/OSCache
Regards,
Glenn
Fabio Salvi wrote:
Hi all,
I've set up an architecture as that suggested by Martin with proxy_mod and a custom tag proxy-web-cashing aware, but the final result is that Tomcat is, even so, eventually called, even if only in order to return a Last-Modified value and not a large amout of unchanged content...
Actually my aim would be to make only Apache's host manage requests for unchanged-content jsp, without contacting the business logic tier at all...Has somebody found a solution to that?
Thanks in advance,
Fabio
-----Messaggio originale-----
Da: Martin Algesten [mailto:[EMAIL PROTECTED]]
Inviato: mer 29/01/2003 14.45
A: 'Tomcat Developers List'
Cc:
Oggetto: RE: Ap..cache
Fabio,
We're achieving a good cache result by using mod_proxy and its built in
proxy cache.
We have:
Front servers that do caching and backservers that runs the tomcat.
The fron servers runs apache and mod_proxy. Any request coming in to
example www.foo.com/index.jsp is proxied through to the back hosts where
another apache is listening on port 80. The apache on the back host uses
mod_jk to connect to Tomcat which serves the page.
mod_proxy on the fron hosts has a proxy cache which can be used to cache
our jsp pages. There are some simple rules to follow when you want a jsp
to be cached in a generic web cache (see HTTP protocol for details on
web caches).
We got it sorted so that a request that comes into the front hosts, will
only result in a revalidation (If-Modified-Since) to the back hosts. The
jsp page can be coded to deal with this type of request and can then
tell the front hosts to serve the cached page or return a new one.
Martin
> -----Original Message-----
> From: Fabio Salvi [mailto:[EMAIL PROTECTED]]
> Sent: 29 January 2003 10:43
> To: [EMAIL PROTECTED]
> Subject: Ap..cache
>
>
> Hi all,
>
> recently I've been thinking about a way to implement a cache
> mechanism in Apache-Tomcat interaction (e.g. ajp13). I'd be
> really grateful if you gave me some suggestions or advice on
> the matter. Below I shortly describe what I've built as a
> kind of prototype.
>
> To sum up, I've modified mod_jk (win2000) in some points in
> order to make it cache-aware. I've introduced in httpd.conf
> the following directives:
>
> #
> # normal jk directives
> #
> JkMount /*.jsp ajp13
>
> #Cache extensions
> JkCache on
> JkCacheDirectory C:\cache
>
> This is, basically, the collaboration diagram I've implemented:
>
> . mod_jk intercepts request for /pippo/cachetest.jsp;
> . mod_jk asks Tomcat, at the moment actually a WebApp
> controller, for a list of dirty items in cache folder;
> . then, mod_jk deletes dirty-bit pages in the cache;
> . now mod_jk manages current request. If it finds the
> page in the cache it returns static file to Apache.
> . Otherwise it requires the resource back to the WebApp
> controller. The latter knows if the page is to be cached and
> puts a special tag on the byte stream in response, after
> having dynamically built it;
> . mod_jk receives the response and if it does contain the
> above mentioned tag, mod_jk writes it in the cache folder
> before sending it to Apache. If there's a query string, it'll
> include it in the static resource name.
>
> The second and third steps are an overload respect to normal
> interaction, but that permits to save a lot of elaborating
> time and network roundtrips when you ask for a very heavy
> resource (e.g a jsp which loads many non-volatile and quite
> stable data from a db). All that seems to work
> fine...According to your opinion is a worth-to-develop idea?
>
> Thanks in advance for your advise!
> Fabio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
----------------------------------------------------------------------
Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder |
MOREnet System Programming | * if iz ina coment. |
Missouri Research and Education Network | */ |
----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]