Re: OsCache Newbie question

Wally Bowles <[email protected]>
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <[email protected]>
Ashok,

Look at your application as if it were two main parts, 
Part 1) Create/fetch the dynamic content requested and 
Part 2) Render/display the response using what part #1 gathered.

OSCache is very good at saving your application from having to re-do part 2, the
rendering/displaying of your gathered image.  To stop your application from re-doing part 1,
OSCache was not designed to do this in my observation.  

What to do?
a) Use OSCache filter, to save the whole effort (part 1 + 2) see OSCache filter documentation when
a request comes in for that specific URL.
b) Customize, so that part 1 (the re-fetching of the dynamic content request) can detect that it
should not re-execute because the dynamic content has not changed in the database.  Based on a
flag, or another cache, or some other customized code.

Below is a snippet of a previously asked FAQ concerning the same thing.

Regards,
Wally

(Snippet for a previous asked oscache FAQ) 
The only thing to bear in mind is that caching of JSP fragments using the caching tags may not
achieve the desired results since the MVC architecture of WW generally causes all the hard work to
get done before the JSP is rendered. This means that OSCache would end up caching the rendered
output but *wouldn't* prevent the business logic from being executed


--- Ashok Madhavan <[email protected]> wrote:
> hi all,
> I have 2 or 3 dynamically generated images in my jsp
> page and i want them to be cached. I have statrted
> using oscache. 
> I tried using the 
> <cache:cache key="myChartID" scope="application">
> <embed ..... >
> </cache:cache>
> 
> It does cache the image but the problem is the request
> to the server via the '<embed ...>' is also executed.
> In this case though the image is cached, the database
> query is executed. This is precisely the reason why i
> want to cache the image as the image generation is
> costly.
> 
> Should i use the <cache:cache> tag or the CacheFilter
> for this. 
> 
> I would appreciate any help in this matter.
> 
> 
> Regards
> Ashok Madhavan
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> Opensymphony-oscache mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-oscache


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
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.