tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parsons Technical Services" <parsonstechni...@earthlink.net>
Subject Re: simplest way to cache jsp pages into built "static" files?
Date Tue, 07 Dec 2004 22:54:42 GMT
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" <peter@wizardslair.net>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
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: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message