Skip to:
Content
Pages
Categories
Search
Top
Bottom

Speeding up buddypress

  • Avatar of ewebber
    ewebber
    Participant

    @ewebber

    Hi all,
    I spent some time yesterday playing with YSlow and Pagespeed and a bunch of options to get my site loading faster and I thought I’d share and ask others for their experience/thoughts.
    These are the things I am trying out:

    * FV Gravatar Cache (plugin)
    * WP Minify (plugin)
    * Using dropbox as a CDN http://bp-tricks.com/featured/dropbox-cdn-host-buddypress-wordpress-theme/ (for now until I set up a ‘proper’ CDN)

    Pagespeed also suggests browser caching, I know that some caching tools can cause issues with buddypress, does anyone have any suggestions of the best settings or a walkthrough for this?
    Cheers

Viewing 25 replies - 26 through 50 (of 57 total)
  • Avatar of ewebber
    ewebber
    Participant

    @ewebber

    I think I might give cloudflare a go

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    I will try batche too, seem it solves the problem partially.
    @gregfielding , did you try to deregister the js/css and re-register manually? I setup another domain for this. under this domain, one subdomain for css, one subdomain for js. and put them on Cloudflare. Since all your blogs loading css/js from this domain, it should help a bit.

    Another tool I’m thinking is the WP Multi Network plugin developed by JJJ. I haven’t tried it. From what I’ve reading, it can networking wp site from different domains. So, the idea is to use this plugin to get the network, then, cache the blogs, leave the community site un-cached. What do you guys think?

    Avatar of ds123
    ds123
    Participant

    @ds123

    @gregfielding thanks for the info … my main issue is for logged in users and the very busy activity stream …. is there anyway to not display all the activity ? maybe that will load the page faster ..i use the activity stream as my homepage …. and it is very painful to hit it when logged in its sometimes a couple seconds before you see anything…. i am in the process of getting hyper db running on 2 mysql servers but what is a bummer is that even when their are 10-20 people signed in at same time its still slow …. actually even when there are only a couple the darn activity stream still lags …innodb tables….maxcdn ….w3 total cache..opcode apc
    …any tips to improve the main activity load time?

    Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    @imjscn No, I haven’t tried that. Does it help?

    Avatar of rossagrant
    rossagrant
    Participant

    @rossagrant

    What kind of hosting is everybody using here? I’m just about to launch and expect around 30 concurrent users. I’ve gone for a semi dedicated option but am interested in what others use and where they see slowdown.

    Avatar of nanchante
    nanchante
    Participant

    @nanchante

    Clearly, this is THE one big issue that everyone faces. I agree, thatthere needs to be an official HOW TO for page load speed and performance.

    Granted everyone has different setups, but things like manually combining js and css and calling from a subdomain is something everyone should be able to do, if we are shown how.

    Hosting: am on the 32gb plan with stormondemand.

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @gregfielding , yes, it helps.
    The parallel loading has to be done with cookie free domain– the http://domain.com should not install any dynamic stuff so that it won’t pass cookie to all subdomain. If wp installed on top level domain, the benefits of parallel loading get offset by checking cookie time.
    @tim, combining js is risky, but combining css is easy–just copy them into your own style sheet. The deregister the original. Here’s an example of deregisting and registing:
    `function my_jscss_register() {
    wp_deregister_script( ‘dtheme-ajax-js’ ); // deregister bp’s global. js
    if( !is_admin()){
    wp_deregister_script( ‘jquery’ ); // deregister jquery
    wp_enqueue_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js’ );
    // and other js you want to deregister/register
    }
    wp_enqueue_script( ‘dtheme-ajax-js’, ‘http://static1.domain.com/_inc/global.js’, array( ‘jquery’ ),”,true );
    wp_deregister_style(‘login-with-ajax’);
    // and other css you like to deregister
    wp_enqueue_style(‘my-default-style”,http://static2.domain.com/‘);//the combined css
    }
    add_action( ‘after_setup_theme’, ‘my_jscss_register’ );`

    Avatar of nanchante
    nanchante
    Participant

    @nanchante

    @imjscn: that looks great. I would actually be using a custom combine script, that I would place outside of the Wp functions. ie hard code the combine in either header or footer.

    I assume then that I would only need to deregister css and js, and not do the enqueue bit. Is this right?

    if so, what would the amended snippet look like please?

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @tim , yes , if you don’t need to use original js/css, then, you don’t need to register them back
    `function my_jscss_remover() {
    wp_deregister_script( ‘the-handle-name’ );
    //and others;
    }
    add_action( ‘after_setup_theme’, ‘my_jscss_remover’ );`
    You can find the “the-handle-name” in the plugin’s files at the line when it load the js/css, it normally use wp_enqueue_script , or wp_enqueue_styles, to load js/css. Sometimes they can also use reqire function, but as long as you find the specific file.js , that’s the line.

    When you register your own js, the final parameter “true” means put it in footer. If your js require to run before the page finish loading, you don’t need this “true”.
    You can also add like this: if bp_is_page(‘xyz’), then, the js will be loaded only on the page you need.
    Please remember that, at this point, your js/css are not minified yet.

    Avatar of nanchante
    nanchante
    Participant

    @nanchante

    Thanks a lot. I plan to not add them in via wp, but manually use our inhouse combine script which gzips and minifies at the same time.

    Thanks again. Will let you now how it goes.

    Avatar of James
    James
    Participant

    @janismo

    tried w3 total cache on localhost, don’t know how for others, but for my non english installation it caches/saves page text as unknown symbols.

    Edit: had to disable page cache and now it works fine, I think so, at least nothing goes wrong.

    Avatar of Bowe
    Bowe
    Participant

    @bowromir

    I’ve just published a tutorial about setting up a CDN with Total Cache and MaxCDN. It does wonders for me, and takes care of the parallel loading and serving of your static files through a CDN:

    http://bp-tricks.com/featured/the-perfect-cdn-setup-for-buddypress-using-maxcdn-and-w3-total-cache/#comment-174097306

    Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    “This page has 33 external Javascript scripts. Try combining them into one.
    This page has 21 external stylesheets. Try combining them into one.”

    This is my problem and I’m guessing the problem that a lot of us are having. Cloudflare will load the CSS and JS, but there are still so many that it slows sites down.

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Buddypress shouldn’t slow anything down at all. Unless you have a bad host, and poor space, your site should load, and load functions, just as fast as if it was not installed.

    Unless, your talking about, for instance, just buddypress components. Have you read this article? http://wpmu.org/speed-up-your-wordpress-buddypress-loading-time-with-this-quick-tip/

    Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    It’s not directly a Buddypress issue. It’s a plugin and hack issue. Where most standard wordpress blogs may only have the need for a few plugins, complex Buddypress communities have lots of plugins.

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    It was a good day when Bowe showed me I could use MAXCDN to cache avatars… It was not working with my older AMAZON S3 CDN solution and I was actively trying to find someone for over 7 months to tell me why! Today, I finally got the xcache php opcode to work on both my server and for specifically for BuddyPress (using it for database caching via w3tc). Things are moving along quite nicely now.

    The key to maximizing MAXCDN is to cache all of your plugins’ css, images, and javascripts… once you do this, it flies!

    Reposting Bowe’s Link here for MAXCDN and BP:
    http://bp-tricks.com/featured/the-perfect-cdn-setup-for-buddypress-using-maxcdn-and-w3-total-cache/#comment-174097306

    With regard to wp-minify or w3tc minify and buddypress, I’ve never been happy with the results of this as usually it will stop something completely from functioning, no matter how careful I was in trying to exclude potential CSS/JS issues individually. I am using wp-minify successfully on a number of less active WordPress sites though… I may give minify a go again some time later, much later! :)

    Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    @bowe
    Do you know if there is any way to use MaxCDN without W3TC?

    I use multiple databases and therefore can’t use W3TC…

    Avatar of Bowe
    Bowe
    Participant

    @bowromir

    @Pisanojm: This stuff is a great motivation to keep writing tutorials for BuddyPress. Great to hear that it helped for your community :)

    @Gregfielding. you could use the CDN Sync Tool as well: http://wordpress.org/extend/plugins/cdn-sync-tool/.

    BUT I would advise you to till install W3 Total Cache and simply disable all the caching functionality. It’s a matter of ticking a few boxes, and only enabling the CDN option. I have not tested the CDN Sync Tool, but the huge benefit of Total Cache is the inclusion of custom files to be served through the CDN:

    This is the big trick on getting avatars/group-avatars and static files served with max speeds :-)

    Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    Bowe, have you looked at Cloudflare? Curious what your take would be…

    Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    Analytic Your Page Speed

    1) BuddyPress.org got an overall Page Speed Score of 59 (out of 100).

    2) CUNY Academic Commons got an overall Page Speed Score of 58 (out of 100).

    3) Bp-tricks.com got an overall Page Speed Score of 74 (out of 100).

    4) Yoast.com got an overall Page Speed Score of 87 (out of 100).

    You should be able to optimizing your site goes faster.

    Avatar of Bowe
    Bowe
    Participant

    @bowromir

    Awesome! I’m really happy with those results.. Beating Yoast is impossible since he’s not running BuddyPress.. so needs a lot less scripts :-) And don’t forget I’m running about 30 plugins more then BP.org.. (not to brag or anything lol).

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    Just a quantity FYI. My MAXCDN sites are serving about 200-300 megabytes of information per day. I have two highly visited sites that receive about 1000 uniques per day, so this will give you and idea as to how long one terrabyte of of data will last you with the MAXCDN lowest-price plan.

    At 250 Megabytes per day that is 1 Gigabyte per 4 days. So 1000 gigabytes will give you 4000 days, but you only get that amount per year, so you would renew again after 1 year and the limits would be re-established. Even if you are pulling 1 gigabyte per day, you would have 1,000 days (again only 365 in a year). So, before you would have to be looking at a larger pay-plan with MAXCDN you would need to be pulling about 3 gigabytes of information per day to exceed the MAXCDN low-price plan limit. Just some info/thoughts.

    Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    @pisanojm

    What configuration of sites do you have with MaxCDN? I’ve heard there are some problems with multi-site blog farms where sub-blog uploads aren’t cached correctly.

    Avatar of Pisanojm
    Pisanojm
    Participant

    @pisanojm

    Greg, I am using W3TC for object caching (xcache opcode) and browser caching. Along with that I am using MAXCDN as the CDN (was prior using Amazon S3). MAXCDN is set now to cache almost all of my graphics, css, and javascripts -including plugins and child-themes. One of the two sites I was referring to is a straight WordPress site: http://mustech.net and the other is a BUDDYPRESS, non-multi-site (single site), site (htttp://musicpln.org – registration only).

    I’ve set up a different pullzone for each of the sites using maxcdn.

    Avatar of nanchante
    nanchante
    Participant

    @nanchante

    MIhgt be a dumb question, but can someone explain please what relative benefits are between object aching and database caching? What are the downsides too?

    We use eAccelerator on our server.

Viewing 25 replies - 26 through 50 (of 57 total)

You must be logged in to reply to this topic.