Suggestion Ajax Threads

Discussion in 'Community Matters' started by ChrisGrigg, Jan 18, 2019.

  1. Ghost

    Ghost Seasoned Veteran

    2,962
    27
    115
    +63
    0
    -0
    Yeah, true - If MySQL caching is set up properly, when you INSERT a new post you are taken to the thread, which then performs a SELECT to get the new post - not in all cases
    This would then store the SELECT in cache allowing the auto refresh to access the cache results instead of a brand new select

    Could also store the # of replies in a column for thread info instead of the thread replies table being queried. This is an extremely fast query to run, so even if done manually w/ ignoring the cache, the performance hit would not be much
     
    • Like Like x 1
  2. Azareal

    Azareal Paragon

    1,603
    116
    130
    +274
    10
    -0
    I don't think you can hold a cache on shared hosting.
    Forum Promotion uses a shared host, but it would need a VPS to run APCu.
     
  3. Dagex

    Dagex Resident

    561
    43
    45
    +71
    13
    -0
    I've heard of Ajax but I'm not sure what it does. Is it like a Live-Chat thing like Discord? I would actually like something like that instead of having to refresh 24/7. But FP does show a pop-up whenever you get a notification while browsing the forum. But again, it'd be a good idea for something like that.
    (Please do explain it to me though as I don't have a clue about Ajax. I've only heard of it)
     
  4. Azareal

    Azareal Paragon

    1,603
    116
    130
    +274
    10
    -0
    Basically, AJAX fires off a request every second (or whatever the interval is) to ask the server for more messages.
    Technologies like WebSockets however, like in Discord, hold open a connection and the server pushes through messages whenever something happens.

    AJAX is the one which hammers the hell out of a server.
    WebSockets is the one which is a lot more efficient, although it does involve holding quite a few connections open and you'll need a far more recent forum software than XenForo, most likely.

    Discord would probably go bankrupt, if they used AJAX.
     
    Last edited: Mar 6, 2019
    • Like Like x 1