You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kaspar Fischer <fi...@inf.ethz.ch> on 2007/11/28 12:37:04 UTC

Caching: dependency on session data [OT?]

Dear All,

I've tried to search for information on Tapestry's caching mechansism
but could not find anything regarding depency on session data (like
logged in users).

Reading from

   http://www.nabble.com/RE%3A-Page-caching-nightmare-p3574110.html

I understand that tapestry has its page pool but does not cache
rendered pages. Is this correct?

If so, my next question is slightly off-topic: How can I implement
caching? Lots of data I display on my Tapestry pages is pulled from
a DB and this might be expensive. I see two approaches:

* Caching "in front of T": use some page cache that caches the
   HTML output by T

* Caching "behind T": use a caching layer between T and my DB

The first approach seems easier but becomes complicated as soon as
my pages depend on session data (e.g., the page displays the name of
the logged in user -- you'd have to use a per-user page cache).

Because my pages change frequently, I need -- in both approaches --
a cache that allows "dependencies". That is, the cache should
not just be a (stored) hash-map but each stored entry may have
a list of dependent pages: If one of the latter changes, the entry
in the cache gets invalidated.

For instance,

   page A depends on content from no other page,
   page B depends on {A} (because it links to it, showing its title,  
for instance),
   page C depends on {A, B}.

After some time, all three pages are cached. If I change B, then
the cache should invalidate B and C but should leave the cache
entry for A in the cache.

Does anybody have any experiences with a mechansism like this?
Are there any caching libraries out there that accomplish this?

Many thanks and please excuse the slightly off-topic nature of this
post.

Kaspar

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Caching: dependency on session data [OT?]

Posted by Francois Armand <fa...@linagora.com>.
Kaspar Fischer wrote:
> Dear All,

Helllo,
>
> If so, my next question is slightly off-topic: How can I implement
> caching? Lots of data I display on my Tapestry pages is pulled from
> a DB and this might be expensive. I see two approaches:
>
> * Caching "in front of T": use some page cache that caches the
>   HTML output by T
>
> * Caching "behind T": use a caching layer between T and my DB
>
> [...]
> Does anybody have any experiences with a mechansism like this?
> Are there any caching libraries out there that accomplish this?
I haven't any experience in caching a webapp, but perhaps that you can 
have another solution that is :
* cache the object pulled from the DB. For that, you can rely upon the 
caching system of your ORM, or use a caching library (for instance 
EhCache : http://ehcache.sourceforge.net).

I use EhCache for caching expensive authorization evaluation, and it 
works well.

-- 
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
-----------
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/
Open Source identities management and federation


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org