aspose file tools*
The moose likes JForum and the fly likes How dose Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "How dose "hottest topic" work in cache?Can it update topic list to cache automaticly?" Watch "How dose "hottest topic" work in cache?Can it update topic list to cache automaticly?" New topic
Author

How dose "hottest topic" work in cache?Can it update topic list to cache automaticly?

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
i use version 2.1.8.
i have set "topic.cache.enabled = true" in "SystemGlobals.properties"
i found that the topic list in "hottest topic" can't update until i restarted tomcat.
i want to know can it update automaticly if i set "topic.cache.enabled = true" without restarting tomcat.
If it can update automaticly ,how long time once?
If it can't , how to? restart the tomcat?




thank you very much for answering my questions
[originally posted on jforum.net by zhpx64]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hmm, the Hottest Topics function was just added in 2.1.8... I believe it was mostly from "contributed" code (e.g., somebody had a need, did it for their specific need, and donated it. It looks like there are a few areas that didn't get looked at too closely.

From a quick delve into the code, it looks like if cache is enabled, the loadHottestTopics() method is only called if a topic or post is deleted.

So, to update it, you have to add a post and then deleted. There doesn't seem to be any other way to do this.

If you're looking to modify the code, I'm thinking that the best way might be to add a "freshness" timestamp to the load and get methods in the TopicRepository. Then check it in the get method to determine if it needs to be loaded.

One thing to think about is that caching topics may not be as big a performance boost as you think it is. With the DB connection pooling, faster machines, and faster DB servers, you may only need this if your site has very high numbers of users.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
monroe wrote:Hmm, the Hottest Topics function was just added in 2.1.8... I believe it was mostly from "contributed" code (e.g., somebody had a need, did it for their specific need, and donated it. It looks like there are a few areas that didn't get looked at too closely.

From a quick delve into the code, it looks like if cache is enabled, the loadHottestTopics() method is only called if a topic or post is deleted.

So, to update it, you have to add a post and then deleted. There doesn't seem to be any other way to do this.

If you're looking to modify the code, I'm thinking that the best way might be to add a "freshness" timestamp to the load and get methods in the TopicRepository. Then check it in the get method to determine if it needs to be loaded.

One thing to think about is that caching topics may not be as big a performance boost as you think it is. With the DB connection pooling, faster machines, and faster DB servers, you may only need this if your site has very high numbers of users.


thank you so much!!!
[originally posted on jforum.net by zhpx64]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How dose "hottest topic" work in cache?Can it update topic list to cache automaticly?