BuddyDev

Search

[Resolved] Why does BP Members Directory reload every time?

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #23128

    Hi there, I noticed that the members directory reloads when returning to the directory after visiting a single member profile.

    I thing the load of the directory, even with few members is extremely slow, compared to other directories, and having the directory reloading every time the directory is revisited does not make it better.

    I am using a cache plugin which makes no difference for the loading time.

    I have these general questions to the directory

    1. Is the structure of the members directory just slow in general?
    2. Why does the directory need to reload on an on again?
    3. Why does the directory load from the top, after visiting a single member, and not return to the row you were? This is probably connected to the fact that the directory reloads.

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #23175

    Hi Carsten,
    Thank you for the question.

    1. Since your members directory is a dynamic web page, every time it is visited, It is reloaded.

    You can not use page caching for this, database caching and object caching may help.

    If your members directory is very slow, My suggestion will be to check for the reason. You may try query monitor or similar plugin to check for memory usage/database query as basic tools.

    If that does not help, you may go for profiling the setup to identify the bottlenecks.

    Most of the time, It is either database queries or media.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #23179

    Hi Brajesh, to my question number 3, the returning to directory issue, is this not possible to solve, by adding some kind of bookmark to the row, in the directory?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #23180

    Hi Carsten,
    The experience you are looking for is more like an app experience than a web page experience.

    The reason a user is sent at top is because when the browser loads the member directory, the content is loaded via ajax(depends on your template pack) and browser is not aware where it was previously.

    Yes, it is doable, but I will leave that in the scope of plugins(and how they load member directory). They can set a cookie and use that to fetch the specific page of member list and scroll to it.

    I do not think there is any solution that I can help apply cleanly without modifying the theme/template pack’s js file.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #23182
    This reply has been marked as private.
  • Participant
    Level: Yogi
    Posts: 1105
    calu on #23988

    Hi Brajesh, I’m still looking for a solution to this members directory reload.

    Since ajax seems to be the reason for this, my questions is, if it would be possible to turn of ajax and use SQL instead to load the database?

    Best
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #24038

    Hi Carsten,
    If you are using bp-legacy, you can modify yourtheme/buddypress/members/members-loop.php and replace this line

    
    <div id="pag-top" class="pagination">
    

    with this

    
    <div id="pag-top" class="pagination no-ajax">
    

    same for the bottom of the file

    Replace this

    
    <div id="pag-bottom" class="pagination">
    

    with

    
    <div id="pag-bottom" class="pagination no-ajax">
    

    That will disable ajax loading.

    PS:- If the file is not there, you may copy it from wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/ to your theme/buddypress/members .

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #24041

    Hi Brajesh, thanks for the code, unfortunately I’m using Nouveau, is it not possible to deactivate Ajax here?

    Best
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #24042

    Hi Carsten,
    I am sorry but I don’t see a simple solution. It might be achieved by unbinding js events but that makes it complex.

    I won’t be able to assist you with it.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #24044

    That’s bad news, since I invested a lot of time and money in Nouveau.

    There seems to be a lot of disadvantages to Nouveau.

    I noticed that Legacy loads the directory much faster than Nouveau, no need for a warning saying that your directory is loading.

    So why is Nouveau described by many as the template to go with, what would be your choice?

The topic ‘ [Resolved] Why does BP Members Directory reload every time?’ is closed to new replies.

This topic is: resolved