You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by QM <qm...@brandxdev.net> on 2005/01/09 19:25:00 UTC

Re: Pagecache framework?

On Tue, Jun 07, 2005 at 08:12:13PM +0200, Mieke Banderas wrote:
: What should I look for if I want a simplistic system for avoiding trips
: to the DB for pages that are only built upon and between changes are 100%
: similar? Is there a cache framework I should look into or could I use
: something even simpler? After all, most pages only occasionally have true
: dynamic needs. I suppose I'm looking for something like a publishing
: system, only much much simpler, especially on how much resources (and
: coding) it would need.


So are you looking to cache *pages* (generated HTML content) or simply
*data* (information pulled from the DB that is manipulated by the
presentation layer)?

For the former, there are ways to make the Apache httpd a content
caching engine.  This works well if the content you'd like cached is
global -- that is, not tied to a specific user or group login.  (You
could also use webDAV for this._

For the latter, you could roll your own persistence caching framework or
look into something such as IBatis or Hibernate that will do the grunt
work for you.  If your code has uniform, centralized, abstracted data
access then slipping in another layer between your app and the database
shouldn't require much in the way of noticeable changes.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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


Re: Pagecache framework?

Posted by QM <qm...@brandxdev.net>.
On Tue, Jan 11, 2005 at 01:38:45PM +0100, Mieke Banderas wrote:
: If there is no performance penalty on my slow G3 hardware, as I'd need to
: use mod_jk and Apache as opposed to just Tomcat, then cached HTML pages
: (ending in .jsp probably) is what I want.

: What solutions involving Tomcat only is there?

Do you mean, something builtin to Tomcat itself? Not likely.  Tomcat
doesn't know about your app.  It shouldn't have to.

This one's all you.  =)

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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


Re: Pagecache framework?

Posted by Mieke Banderas <mi...@gamebox.net>.
Mike Fuellbrandt said:

>How about this?
>
>http://www.servlets.com/cos/javadoc/com/oreilly/servlet/CacheHttpServlet.html

Thanks Mike, I'll check it out.


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


Re: Pagecache framework?

Posted by Mike Fuellbrandt <mi...@gmail.com>.
How about this?

http://www.servlets.com/cos/javadoc/com/oreilly/servlet/CacheHttpServlet.html

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


Re: Pagecache framework?

Posted by Mieke Banderas <mi...@gamebox.net>.
QM said:

>For the former, there are ways to make the Apache httpd a content
>caching engine.  This works well if the content you'd like cached is
>global -- that is, not tied to a specific user or group login.  (You
>could also use webDAV for this._

If there is no performance penalty on my slow G3 hardware, as I'd need to
use mod_jk and Apache as opposed to just Tomcat, then cached HTML pages
(ending in .jsp probably) is what I want.

What solutions involving Tomcat only is there?


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


Re: Pagecache framework?

Posted by Parsons Technical Services <pa...@earthlink.net>.
One other aspect to think about that will help, is to consider the cause of 
the dynamic.

If the difference in the page is due to the client then that page would need 
to be current data. But if the dynamic nature if from an outside change and 
the client has no affect on the content, then the question would be how 
often the page should be updated.

Adding a layer and using it for this makes sense.

I used a persistent object that would query the database and create the body 
of the page, storing it as a string. Then when the client did a request the 
page did a request to the object for the string, inserted it as the body and 
served it back to the client. The object would query the database every five 
minutes to get current data.

To take this one more step would be the creation of Beans with listeners. 
Then when a change to the database was made that affected that page it would 
trigger the listener and the bean would do a query and update the 
page/body/string/etc that it stores.

Now if this model exist I would love to know before I build it next month.

So if your client does not change the query, do the query and store the page 
and or body.

I wrote the object in about 4 hours one night after one of my sites was 
brought down from too much unexpected traffic.

The nice part with these as solutions, it doesn't rely on any external 
program and thus you could run on Tomcat only.

Just another option to consider.

$0.015   Everyone says I've lost half my sense.

Doug

----- Original Message ----- 
From: "QM" <qm...@brandxdev.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Sunday, January 09, 2005 1:25 PM
Subject: Re: Pagecache framework?


> On Tue, Jun 07, 2005 at 08:12:13PM +0200, Mieke Banderas wrote:
> : What should I look for if I want a simplistic system for avoiding trips
> : to the DB for pages that are only built upon and between changes are 
> 100%
> : similar? Is there a cache framework I should look into or could I use
> : something even simpler? After all, most pages only occasionally have 
> true
> : dynamic needs. I suppose I'm looking for something like a publishing
> : system, only much much simpler, especially on how much resources (and
> : coding) it would need.
>
>
> So are you looking to cache *pages* (generated HTML content) or simply
> *data* (information pulled from the DB that is manipulated by the
> presentation layer)?
>
> For the former, there are ways to make the Apache httpd a content
> caching engine.  This works well if the content you'd like cached is
> global -- that is, not tied to a specific user or group login.  (You
> could also use webDAV for this._
>
> For the latter, you could roll your own persistence caching framework or
> look into something such as IBatis or Hibernate that will do the grunt
> work for you.  If your code has uniform, centralized, abstracted data
> access then slipping in another layer between your app and the database
> shouldn't require much in the way of noticeable changes.
>
> -QM
>
> -- 
>
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
>
>
> ---------------------------------------------------------------------
> 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