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

Why xenforo doesn't have postparsed table to save queries?

#1
Is there any add-on to save parsed posts in a temporary table like vbulletin because this is very useful when we have some add-ons that execute multiple queries with every page load! I could save about 200 queries with this option on vbulletin because I use custom add-on that shorten external links and create unique id for every link, see this thread, unfortunately about 200 queries executed with every page load because there is no post cache option in xenforo

http://www.egykit.com/threads/8485/

I've enabled debug mode for my IP address only

Timing: 0.6903 seconds Memory: 10.961 MB DB Queries:205

P.S: it may took few seconds when you load the external link as it grab the remote page title, this is done only one time with the 1st view of the external link!
 
#5
Hmm.... maybe you should think about handling this at post creation / edit instead of run time.
I thought about that, but I prefer to keep external links unchanged in member's posts because I use custom add-on to update external links on post edit to prevent creation of duplicate links :(
 

Rob

Well-known member
#6
I thought about that, but I prefer to keep external links unchanged in member's posts :(
Well, I don't think there is a way to not to do that. If you have to look up every link and maybe transform it to a short url then the options are:-
  • Do it in real time
  • Do it at the time of insertion / editing
I'm not if a future release will include a post parsed table or not.

It would be easy to do a reverse look up to transform the short url's back into full urls for editing ;)
 
#7
Well, I don't think there is a way to not to do that. If you have to look up every link and maybe transform it to a short url then the options are:-
  • Do it in real time
  • Do it at the time of insertion / editing
I'm not if a future release will include a post parsed table or not.

It would be easy to do a reverse look up to transform the short url's back into full urls for editing ;)
What about if the shorten url title have dot "." followed by number? it will cause conflict when I preg match the shorten url id :(

I prefer to have post cache system built in with xenforo.
 
#9
Apparently you make a query for each individual URL you rewrite? Why not collect the URLs first and then make a single query instead?
But how could insert the external links at once if they doesn't exist? should I use array to compare the original links in the post and the existing links in the external links table?
 
#10
Done! saved 273 queries with every page load :) only the 1st view run multiple queries to save external links to the database then only one query to the database could check for new external links in the post, insert new links, update existing links in the database when members add new links in any part of the post, i.e no new links will be created and will save duplicate links per post! :)