This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes Caching results on a tab based web page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Caching results on a tab based web page" Watch "Caching results on a tab based web page" New topic
Author

Caching results on a tab based web page

Ajay Njallacattu
Ranch Hand

Joined: Nov 21, 2006
Posts: 36
Dear All,

I have a web page which is having 4 tabs. The first tab is shown default on the load of the page. When the user clicks on the 2nd tab the data relevent to the second tab is retrieved from Database and displayed. The same happens when you move to 3rd and 4th tab for the first time.

If the user goes back to any tab which is already viewed by this user, I dont want to query it again from the Database. Instead we need to retrive the previous retrived results.

What is the best way to do it? Is there any caching mechanism to achive this.

Thanks n Regards

Ajay Joseph
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

If the data is user-specific, cache it in the session. If it's common across all users, cache it in application scope.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Ajay Njallacattu
Ranch Hand

Joined: Nov 21, 2006
Posts: 36

This data is user specific. For this application there can be around 300-400 concurrent users. If we are putting it into session will it impact the performance of the web application?

Is there Caching API through which we can achive this more efficiently?

Please suggest.


Thanks

Ajay Joseph
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

I'm sure there is -- I've always rolled by own.
Ajay Njallacattu
Ranch Hand

Joined: Nov 21, 2006
Posts: 36
Bear,

Thanks a lot for you quick responses. Could you suggest me something if you have used any?

Regards

Ajay Joseph
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

Bear Bibeault wrote:I've always rolled by own.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Caching results on a tab based web page
 
Similar Threads
Caching of Query Results
do we need to always access the business tier
Caching in Rails application
Avoiding menu buttons from tab order
struts 2: application in different tabs