1. 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?

Discussion in 'General XenForo Discussion and Feedback' started by EgyKit, May 19, 2012.

  1. EgyKit

    EgyKit Member

    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!
     
  2. Rob

    Rob Well-Known Member

    200 queries? Really?
     
  3. EgyKit

    EgyKit Member

    Yes, because it handle all external links in the post :) I set limit on url number per post for members except for me :)
     
  4. Rob

    Rob Well-Known Member

    Hmm.... maybe you should think about handling this at post creation / edit instead of run time.
     
  5. EgyKit

    EgyKit Member

    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 :(
     
  6. Rob

    Rob Well-Known Member

    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. EgyKit

    EgyKit Member

    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.
     
  8. AlexT

    AlexT Well-Known Member

    Deleted
     
    ragtek likes this.
  9. EgyKit

    EgyKit Member

    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. EgyKit

    EgyKit Member

    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! :)
     
    CurveGotti and Rob like this.
  11. Rob

    Rob Well-Known Member

    There is always a way :)
     

Share This Page