File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes caching pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "caching pages" Watch "caching pages" New topic
Author

caching pages

Ilja Smoli
Ranch Hand

Joined: Dec 02, 2001
Posts: 64
Hi
I'm not sure is it right forum im posting to... (anyway moderators will move it to correct one )

Question is folowing:

In my action class I put in a request an List object (which represents our web app reports) which I iterate later on jsp page... then on this jsp page I have a button "Print" which opens in a new window same "print friendly" data. Since DB is growing some of reports queries take about 5-10 min. So when user first time load a report data he waits for 5 min, and then when he wants to print it he again have to wait... Not really nice huh?
I thought to put this object in a session, but number of reports growing, and if user will run all of them...
Any suggestions...
Thx in advance..
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
What you need is a cache that you can store those complete reports to (and which drops the oldest or most rarely accessed reports when running out of space). I'm not aware of any particular object cache I could recommend but I'm sure there are such libraries freely available. On the other hand, you might also consider using a caching layer on top of your JDBC code and see if that would improve the performance enough.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ilja Smoli
Ranch Hand

Joined: Dec 02, 2001
Posts: 64
Hi
Thx for reply
Actually I was thinking about "object cache" and I was suspecting some recomendations on it

And what about JDBC top layer cache, can you tell a little bit more on this please?

Thx
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Ilja Smoli:
And what about JDBC top layer cache, can you tell a little bit more on this please?

Well, if you would be using Hibernate for persisting your objects into the database, you'd get caching for free and you'd even get to choose from a number of caching implementations to choose from, ranging from JBoss-Cache to EHCache to OSCache to SwarmCache (and I probably forgot one or two, still).

If this isn't an option and/or doesn't help your application's performance, then I'd strongly suggest you look into caching the full reports themselves using an in-memory object cache such as ShiftOne/JOCache, WhirlyCache or Jakarta Commons Cache, or a disk-based cache where you store the complete reports ready for the next user.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: caching pages