Not planned Cache rebuilder for BB code parse cache

Chris D

XenForo developer
Staff member
If you have an existing 1.1.x board that has been upgraded to 1.2.x then you are likely to have a massive number of posts that have not had the BB code parsing tree cached.

As a result, the first person to view a page in a thread will trigger each post in that page to have its cache inserted into the xf_bb_code_parse_cache table.

This has the potential to increase the query count for loading that page by X where X is the number of posts you show per page.

On a board that I'm yet to upgrade to 1.2, that could be as many as 40 additional queries.

Although these queries only happen for the first person to view that page, and only ever happen once, I still wonder if it would be better to provide a cache rebuilder so we can run this ourselves at an appropriate time.

Personally on sites I'm involved with they're usually on big VPS' or dedicated servers so it's not an issue. But those additional queries happening at run time (as small as they are) could potentially adversely affect performance.
 
Upvote 7
This suggestion has been closed. Votes are no longer accepted.
Imagine: XenForo fetches the forum template, and everytime it checks if the template is cached within the file system. If not, it saves it as a file.

Why not save the bbcode once its created? Why check every page view if posts are cached? It's rather old school.Yes the current BBCode Implementation hurts definitly Googles impression of the speed of our community. From what I heard, it means less money coming from Adsense if you have a slower web page.

This super short shell script at least puts the first page of all threads in the cache:
PHP:
#!/bin/bash

for ((i=PUTYOURHIGHESTTHREADIDHERE; $i>=0; i--)); do
  wget  --no-cache --spider  http://domain.com.de/threads/$i/
  echo $i
done

exit
EOI
 
I just thought about this option as it does sum up to a serious amount of data within the database. I guess the bbcode parse cache only speeds up a page when there are bbcodes used within the posts? It would be great if someone would just confirm it.
 
In case anyone wants to still do this, modified @Marcus script to do every post :D

Code:
#!/bin/bash

WEBSITE="localhost"
POSTNUM="100000"

for ((i=0; $i < $POSTNUM; i++)); do
  curl -ILk https://$WEBSITE/posts/$i/
  echo $i
done

exit
EOI
 
What a useless suggestion ;)

We actually removed the BB code parse cache in XF 2.0 as it wasn't particularly useful for the majority of forums hence this particular suggestion isn't going to go anywhere.
 
What a useless suggestion ;)

We actually removed the BB code parse cache in XF 2.0 as it wasn't particularly useful for the majority of forums hence this particular suggestion isn't going to go anywhere.
It hasn't gone anywhere for a year though.
admin.webp
 
Top Bottom