Jump to:

1036 Posts in 810 Topics by 315 members

Forum Module

SilverStripe Forums » Forum Module » Forum caching

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1867 Views
  • Ishmael
    Avatar
    Community Member
    3 Posts

    Forum caching Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Forum caching Link to this post

    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

  • Ishmael
    Avatar
    Community Member
    3 Posts

    Re: Forum caching Link to this post

    Thanks, Will. Is it possible to just set

    HTTP::set_cache_age

    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.

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Forum caching Link to this post

    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); } ..

  • Ishmael
    Avatar
    Community Member
    3 Posts

    Re: Forum caching Link to this post

    OK, I will try that - it looks like a better way to go.

    1867 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.