RE: Dependency mapping in OSCache?

"Chico Charlesworth" <[email protected]>
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <[email protected]>
kewl ... Umm i see how Velocity sits well within that framework.

A XML/XSL approach might work well too I guess, where XML is stored in
cache, and then the XSL template is applied post-cache, but not too sure on
performance then ...

cheers 4 the feedback though :)
chico


-----Original Message-----
From: Chris Miller [mailto:[email protected]]
Sent: 17 May 2004 09:41
To: Chico Charlesworth
Cc: [email protected]
Subject: Re: Dependency mapping in OSCache?


One of the final steps before we serve a piece of content is to
configure a Velocity context with a $user object (from the session),
$system (for dates/times/etc) and maybe one of two others (none of which
access the database). We then use Velocity to process the page that was
retrieved from the cache against this context.

Each type of content (eg 'news article', 'menu', product') has one or
more Velocity templates associated with it. A site designer can put say
$user.FirstName into any template and it will later be caught by the
post-cache pass.

Or something like that - I wrote the code well over a year ago and don't
think I've looked at it since! :-)


Chico Charlesworth wrote:
> Hi,
>
> When you say:
> 'We also have a post-cache processing stage where request or session
> specific
> data (such as user names, the current time etc) can be injected into the
> page.'
>
> How does the post-cache process work?
> How do you 'inject' the request or session specific data into the page?
>
> ta
> chico.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of
> Chris Miller
> Sent: 17 May 2004 09:21
> To: Michael Guyver
> Cc: [email protected]
> Subject: [Opensymphony-oscache] Re: Dependency mapping in OSCache?
>
>
> This is the type of problem the cache grouping functionality can be used
> to solve. In fact, we do something very similar to what you want in our
> in-house CMS product. Pages that are rendered can contain many pieces of
> subcontent, so obviously if one of these pieces of subcontent changes we
> need to expire the cached page(s) that it appears on.
>
> During rendering, a note is made of each piece of content that
> contributes to the page. After rendered when the page is cached it is
> put into several groups, one corresponding to each piece of content it
> depends on. So for example a particular page might end up in groups
> "C100", "C145", "C170" (where the number == the appropriate contentId).
>
> Whenever a piece of content is updated we can just flush eg group "C145"
> which causes all the dependent pages to flush too.
>
> All this is done with a custom CacheAdministrator class that takes
> special Key objects and RenderedContent objects. The RenderedContent
> objects hold the rendered data to cache, plus info such as the cache
> dependencies, locale information, any dependent URL parameters and the
like.
>
> We actually take things a lot further than this. For example rendered
> subcontent is cached seperately too so even if a page has been flushed
> because eg a news item has been updated, parts of the page such as
> menus, headers & footers will still be retrieved from cache. We also
> have a post-cache processing stage where request or session specific
> data (such as user names, the current time etc) can be injected into the
> page.
>
> Hope this helps get you started.
>
> Chris
>
> PS: I've posted this to the OSCache mailing list, generally that's the
> best place to ask questions.
>
>
>
> Michael Guyver wrote:
>
>
>>Hi Chris,
>>
>>Sorry for the liberty of contacting you directly, but I couldn't see a
>>"contact us" link on the website.
>>
>>Is there some sort of object in which you can store dependency mappings in
>>OSCache? I haven't used it but am not sure whether to continue with my
>>efforts or adopt it instead. I have composite objects and would like to be
>>able to ensure that if someone updates a constituent part that any objects
>>which depend on it are released from the cache.
>>
>>I had a quick look through the docs and it looks like I'd have to maintain
>>the dependency mapping and then programmatically cause the caches to flush
>>the dependent objects by key. If there's an easy way or if I've missed
>>something, please let me know!
>>
>>Best wishes,
>>
>>Mike
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: SourceForge.net Broadband
> Sign-up now for SourceForge Broadband and get the fastest
> 6.0/768 connection for only $19.95/mo for the first 3 months!
> http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
> _______________________________________________
> Opensymphony-oscache mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-oscache
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: SourceForge.net Broadband
> Sign-up now for SourceForge Broadband and get the fastest
> 6.0/768 connection for only $19.95/mo for the first 3 months!
> http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click





-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.