Thought of that as well but wasn't sure how to accomodate "built" pages i.e. with includes etc so I ended up with an output filter to store and an input filter to serve. Now what if you don't want Tomcat to serve but rather Apache. Well the output filter would simply need to write to disk where Apache can serve. Ahhh but then how do future requests come through to Tomcat to trigger the regeneration? ... In the end I decided that all requests from logged in users would be dynamic and any content updates would perform the fs writing as part of the update process.

This is a tough one that could be solved by mod_cache at the Apache level iff header exclusions could be specified.

Parsons Technical Services wrote:

Warning, I am going to twist things around a bit here.

What if you wrote the pages that were to be cached as servlets.
These would run in the background and regenerate the page at a set interval. The page is stored in a servlet as a string and served out whenever the servlet receives a matching request.


For stored pages the path would be www.xxx.com/store/somepage.jsp

The servlet located in the store path would use the name of the requested page minus the .jsp to select the proper stored string and serve it back as the page.

So servlet named Junk in place of junk.jsp would create the page on an interval and put it in the servlet called Store as a string named junk, located in the /store path. When a request comes in for www.xxx.com/store/junk.jsp the request is sent to Store as is all /store/jsp request via the mappings. Store then strips the .jsp and uses the name to retrieve the string in the field named junk. In my case it is only the body of the page but could be as much or little of the page as desired.

Hope I didn't confuse things too much.

Doug

www.parsonstechnical.com


----- Original Message ----- From: "Peter Johnson" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 07, 2004 5:18 PM
Subject: Re: simplest way to cache jsp pages into built "static" files?



I was looking into this option as well but one must be careful about session IDs if they are used as the cached page will contain the cookie header.

We use a background process on the server to generate files every 60s and use a "-s" rewrite condition and then rewrite rule to serve.

PJ

Tim Funk wrote:

Have your JSP provide some expiration data headers and then mod_cache might do the trick ...

http://httpd.apache.org/docs-2.1/mod/mod_cache.html

-Tim

Mieke Banderas wrote:

What's the simplest way of caching jsp-generated pages, built by Tomcat
4, so that Apache 2 serves most of these (except a few) as static (but
rebuildable) pages even as the address ends in ".jsp"? The exception
being when the dynamic portion of a page needs to be built just right
after the page is requested. A typical Blogpage could work better with
this scenario, I suppose many Blogs work like that.


What technologies and/or methods would be a good idea to look at? I don't want to spend money for licenses at this stage as there is none
or at least close to that. Also, it should be as simple and non
demanding, concerning setup and hardware, as can be without compromising
basic functionality.


If you know a good article, online resource or book on the subject or if
you otherwise can advice, I'd be very interested to know. Deployment will
probably be on Mac OS X Server 10.2.6 and Apache 2.0.48 with Tomcat 4.1.24.



--------------------------------------------------------------------- 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]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to