Performance issues

11 views
Skip to first unread message

efikim

unread,
May 31, 2010, 8:39:39 AM5/31/10
to K2 Support
I've created a new blog with WordPress 3.0 RC1 and compared the
performance of the default template and latest release of K2, and K2
takes more than twice as long to load a page than the default template
despite the default having a graphic image header to load and K2
doesn't.

Looking at the output from YSlow it looks like the slow loading time
is at least partially down to two things:
the large number of javascript files it has to load
the number of small images that have to be loaded

Could these be combined in the final release version to a single
script file (preferably YUI compressed) to load, and a sprite file for
the images, together with the originals for editting and creating
modified versions?

(I know I could do this myself, but then I'd have to redo it (and
correct all the image references for the sprites) every time a new
version is released.)

Steve Lam

unread,
Jun 2, 2010, 3:18:26 PM6/2/10
to k2-su...@googlegroups.com
You can force WordPress to concatenate and compress scripts/css by defining the following constants:

define('CONCATENATE_SCRIPTS', true);
define('COMPRESS_SCRIPTS', true);

You can define them in your child theme's functions.php or in wp-config.php.

K2's JavaScripts will be compressed using YUI Compressor in the next svn commit. Michael has already substantially reduced the number of sprites K2 loads (only 3 to 4 now).

-Steve

> --
> You received this message because you are subscribed to the Google Groups "K2 Support" group.
> To post to this group, send email to k2-su...@googlegroups.com.
> To unsubscribe from this group, send email to k2-support+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/k2-support?hl=en.
>

efikim

unread,
Jun 2, 2010, 9:22:18 PM6/2/10
to K2 Support
Thanks for that!

Thats a very simple solution :)
I see the YUI compression is in the latest version so I'll download
and check the difference in the latest version with and without the
concatenate and compress and see what the difference is on my test
site. (and if its significant I'll try it on my modified K2 1.03 site
too)

mike

efikim

unread,
Jun 3, 2010, 8:34:16 AM6/3/10
to K2 Support
Unfortunately this has no effect whatsoever placed in the wp-
config.php file.

Searching for CONCATENATE_SCRIPTS in the wordpress codex yielded only
one reference to this, which implied firstly that the default for
CONCATENATE_SCRIPTS was 'true' and secondly that it only applied to
the admin pages anyway.
-quoted from Codex
Disable Javascript Concatenation

To result in a faster administration area, all Javascript files are
concatenated into one URL. If Javascript is failing to work in your
administration area, you can try disabling this feature:

define('CONCATENATE_SCRIPTS', false);
-end quote

Searching

Eric Marden

unread,
Jun 3, 2010, 12:54:33 PM6/3/10
to k2-su...@googlegroups.com
The codex is at times very useless. Try searching in the actual code base.

Two references appeared for me in the latest version of WordPress 3.0 from SVN Trunk in: wp-includes/script-loader.php

12: * define('CONCATENATE_SCRIPTS', false); disables compression and concatenation of scripts and CSS,
728: $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;

In addition I'm going to concatenate all of K2s scripts into one file, to further reduce the number of HTTP Requests.

If you're really serious about getting your YSlow score up and improving front-end performance of WP as a whole, check out w3 total cache.


~e
--
~ Eric Marden
--------------------------------------------------------------------------------------------
I make WordPress do stuff: http://xentek.net/code/
And make it look good: http://getk2.com/
Sometimes, I talk about it too: http://xentek.net/presentations/
Also, I tweet. A lot: http://twitter.com/xentek
--------------------------------------------------------------------------------------------

efikim

unread,
Jun 3, 2010, 1:48:42 PM6/3/10
to K2 Support
Thanks Eric!

If you're going to concatenate all the scripts I'll stop worrying
about all the connections (which seemed the most important thing to
address first) and look at other areas!

I'm currently using Super Cache, but will certainly look at your
suggestion.

Thanks for all your efforts
> > k2-support+...@googlegroups.com<k2-support%2Bunsu...@googlegroups.com>
> > .
> > > > > For more options, visit this group athttp://
> > groups.google.com/group/k2-support?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "K2 Support" group.
> > To post to this group, send email to k2-su...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > k2-support+...@googlegroups.com<k2-support%2Bunsu...@googlegroups.com>
> > .

efikim

unread,
Jun 9, 2010, 10:12:05 AM6/9/10
to K2 Support
In case anyone is interested, w3 total cache is a much more
sophisticated cacheing tool than wp supercache.
On the site I tested it with it gives significantly better results
than supercache (partly because it can combine the javascript files).
On the downside it does need
more configuration and maintenance than supercache - its definitely
not just install and forget!
Thanks again Eric, for mentioning it - I'll be switching my other
blogs over to use it as I move them across to WP 3.0.
Reply all
Reply to author
Forward
0 new messages