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

caching data?

Discussion in 'XenForo Development Discussions' started by Marc, Aug 5, 2011.

  1. Marc

    Marc Well-Known Member

    Hi Guys,
    Having a few issues with the load on the front page of my site. I know what is causing it. It is the modifications that I have loading on the main page such as birthdays, statuses, whos been online, top 24 posters etc etc. Basically just an overkill of front page items on my site.

    Now I dont want to get rid of all these items my users enjoy on the main site, and therefore our thoughts are that some of these items need to be cached. At first thought running a cron job periodically for the given items to put them into new tables, so its litterally delete the old, and insert the new each time. This would mean I could simple do a select * from my table which would be extremely fast. This would seem a good way forward, and a direction I am willing to take.

    However I know there are things that are cached around xenforo that use existing tables to cache data. Wondered if someone could give me their thoughts on this scenario, whether I am going the right way about it, or if not how I would go about it instead.
  2. Deebs

    Deebs Well-Known Member

    If the application (mod) does not support caching there is nothing you can do. Bear that in mind. Are you hitting hundreds/thousands of users on your homepage?
  3. Marc

    Marc Well-Known Member

    What, I couldnt write it in myself?

    I probably hit a couple of hundred at times ... Bare in mind its not server load Im trying to reduce, its forum index load speed for individual users.
  4. Deebs

    Deebs Well-Known Member

    Even so, if the app does not support it you are **** out of luck, caching does not solve everything. I am happy to post my configs.... but at the moment I have several hosts doing the same thing, importing XF as quick as poss. so bear with me.
  5. Marc

    Marc Well-Known Member

    OK I think there is a little loss here. You say if the app does not support it. I'm talking about potentially rewriting parts of the addons. By the app, you mean xenforo or the modifications? Xenforo uses zend caching, this I know just unsure how to go about it. I'm aware that caching does not solve everything, however if for example there is a table, joined to another table, joined to another, with a where clause and 1 of those tables contains 500k rows it is a lot faster on the load of the index page if it is loading select * from xyz where table xyz contains only 10 records. Dealing with data is my career, its the php side of things I am asking about.

    Appreciate you are trying to help btw. :)

    EDIT: Also in the same respect, 1 big query every 15 mins and 1 tiny querys each load IMO is far better than 1 big query on every page load. So even if I go the route of setting up a cron job to populate a table and change the queries in the addon, it is a better solution than current. I'm just asking if there is an alternative.
  6. Deebs

    Deebs Well-Known Member

    If you use APC just to do opcode caching then you will see an improvement. You need to enable XF to use APC variable caching, an entirely differerny thing...
  7. James

    James Well-Known Member

    If the birthday add-on is Ragtek's, I believe it already is set up as a cron job to only run every 24 hours (which makes sense).
  8. Marc

    Marc Well-Known Member

    Honestly, I dunno if its ragteks or not LMAO .....
  9. Marc

    Marc Well-Known Member

    Hmmm .. no its not ..... But will be now I know that LOL. Cheers James.

    Just done the APC caching over the past 24 hours and that has made a massive improvement ... I just wanna make it as fast as I possibly can do, and know some of the items are not as efficient as they could be.
  10. Deebs

    Deebs Well-Known Member

    Forget every addon,do you have an opcode/variable cache loaded? Until you do ignore everyone else.
  11. Marc

    Marc Well-Known Member

    I do indeed
  12. Marc

    Marc Well-Known Member

    Ironically the 2 main culprits ragtek has his own version of both .... And both cached ... :)

    That'll be me sorted.

    Would be interested in any other thoughts on the above however, even if its for my own addons.
  13. ragtek

    ragtek Guest


Share This Page