• 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?

puppi

New member
#1
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.
 

Chris D

XenForo developer
Staff member
#3
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.
 

puppi

New member
#4
@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.
 

Chris D

XenForo developer
Staff member
#5
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.
 

mjda

Active member
#6
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. :)
 

puppi

New member
#7
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. :)
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.