Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

QuickCache for PHP whats for Java

 
Ranch Hand
Posts: 138
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a java web application. My application uses Struts2. My application generates the results of games (each state page have around 10 games and the results are published twice daily for 7 games and two are weekly).

Now I dont want to generate the same html (from JSP everytime) instead I want to Cache the generated HTML page (like PHP Caching) and only generate the new page when ever there is a change in the states data..

Is there any tool like QuickCache for PHP available for Java ?

Or Do I need to program it manually, If yes, can you suggest me the best method to implement this.

Thanks in advance,
Bala.
 
Saloon Keeper
Posts: 6507
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not an expert on Struts, but I would imagine caching some parts of the HTML not being worth the effort. Leave Struts and JSP to cache what they can anyway, and don't worry about it. The only thing for the app to do is to cache the relevant data in memory - not having to obtains and compute the stats, presumably from a DB, is likely to have a bigger effect than trying to avoid some HTML generation.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bala Tilak wrote:Hi All,

I have a java web application. My application uses Struts2. My application generates the results of games (each state page have around 10 games and the results are published twice daily for 7 games and two are weekly).

Now I dont want to generate the same html (from JSP everytime) instead I want to Cache the generated HTML page (like PHP Caching) and only generate the new page when ever there is a change in the states data..

Is there any tool like QuickCache for PHP available for Java ?

Or Do I need to program it manually, If yes, can you suggest me the best method to implement this.

Thanks in advance,
Bala.



EHCache provides support for memory and disk stores. EHCache provides LRU (Least Recently Used), LFU (Least Frequently Used), FIFO (First In First Out) algorithms out-of-the box algorithms for object eviction from memory. EHCache offers support for distributed caching
 
Tim Moores
Saloon Keeper
Posts: 6507
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EhCache does nothing for HTML (fragment) caching. Caching arbitrary data is not the issue.
 
Bala Tilak
Ranch Hand
Posts: 138
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. Yes , as per my research on Internet also , I think, caching frequently accessed data (which dont change often ) from DB is a better choice. So we can avoid DB access for this data.

Now the question is , lets say I have a set of records, the lottery results of a state which change once in a day. I cached these results in Java (as there are 1000s of page requests for the same results on my website.). Is there any Pattern/algorithm to manage this cached data to automatically refresh when the corresponding records updated in DB ?. I am maintaining last updated column in DB for each of this lottery entry. Either programatically or using existing Cache framework in Java.


Regards,
Bala.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic