1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to cache sidebar blocks in XF 1.1.5?

Discussion in 'XenForo Development Discussions' started by puppi, May 30, 2013.

  1. puppi

    puppi New Member

    Hi guys,
    I'd like to cache two blocks (Online users and Recent posts) for something like 2 minutes. If it is possible, how can I do that?
    My apologises if this question being asked before.
  2. Mike

    Mike XenForo Developer Staff Member

    You would need to modify the code to do this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    Also, Recent Posts isn't a default sidebar block.

    So maybe that's from an add-on?

    One add-on worth a look is Widget Framework. It includes a number of sidebar blocks and they all have a caching mechanism built in.
  4. puppi

    puppi New Member

    @Mike, isn't caching settins included in XF 1.2?
    Where can I get guidelines about implementing cache on certain blocks? (I know some PHP but nothing about Zend framework)

    @Chris. That's right. it is a non-free addon.
  5. Chris D

    Chris D XenForo Developer Staff Member

    All sorts of stuff is already cached regardless of the version. There's many ways to cache things. But you still need to code a way to fetch data from the cache, write it to the cache etc.
  6. mjda

    mjda Active Member

    I currently just save the serialized database results in a .txt file. Then on each page load I check the modification date on the text file, and if it's older than X seconds, I update it. Then the data is pulled from that file and pushed to the template. Right now I'm using this same method to display the latest threads and the threads with the most replies. It may not be ideal, but it works fine for me. :)
  7. puppi

    puppi New Member

    A forum that rely on this sort of solutions can not be called a mature forum engine. A mature forum does not assume that users have any knowledge of php.
    I just left for VB mainly because of this, and also because the lack of regexp post filtering.
    I may come back to XF when it offers these basic functionalities out of the box.

Share This Page