941 Posts in 272 Topics by 292 members
Forum Module
SilverStripe Forums » Forum Module » Forum caching
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1697 Views |
-
Forum caching

5 February 2009 at 7:27pm Last edited: 5 February 2009 7:27pm
I am running SilverStripe 2.2.3 with the forum module. I would like to know how to prevent the forum from caching as heavily as it does. Whenever I go to a forum page it always displays the old topics until I refresh the page. This happens in every browser. Is it simply a question of checking the "Refresh this forum" box in the admin area? What does that do?
-
Re: Forum caching

9 February 2009 at 10:23am
Refresh this forum is an old feature (which I think have been stripped out but admin field is there still), this used to refresh the forum via AJAX every 30secs/ 1min etc.
One way you can stop SilverStripe from caching is to put this in your mysite/_config.php file HTTP::set_cache_age(0);. Or if you just want the forum holder view to not cache just try put that in forum/code/ForumHolder.php inside the
function init() {
// put it here
...
}And see if that makes a difference
-
Re: Forum caching

9 February 2009 at 10:46am
Thanks, Will. Is it possible to just set
in /forum/_config.php instead of changing the core SilverStripe code? The forum is the only place that I am having trouble with caching, so I don't want to set it at site level.HTTP::set_cache_age
-
Re: Forum caching

9 February 2009 at 10:54am
I think even if you put it in forum/_config.php it will still include it site wide. You could try (it the set_cache_age works) in your own Page.php file - in the function init() { if($this->ClassName == 'ForumHolder') { HTTP::set_cache_age(0); } ..
-
Re: Forum caching

9 February 2009 at 10:55am
OK, I will try that - it looks like a better way to go.
| 1697 Views | ||
|
Page:
1
|
Go to Top |


