MyBB Community Forums

Full Version: Compressing Javascript?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was just looking over at Google Webmaster Tools, and they claim that my site's slow (slower than 92% of websites), and one striking reason, according to them, is that I can compress my JavaScript/CSS files. This was what they listed.

Quote:http://www.rockbandhelp.com/forum/jscrip...s?ver=1400 (16.2 KB)
http://www.rockbandhelp.com/forum/jscrip...s?ver=1400 (1.78 KB)
http://www.rockbandhelp.com/forum/jscrip...s?ver=1400 (53.3 KB)
http://widgets.twimg.com/j/2/widget.js (20.2 KB)
http://www.rockbandhelp.com/forum/jscrip...js?ver=210 (4.40 KB)
http://widgets.twimg.com/j/2/widget-2.2.css (2.39 KB)
http://www.rockbandhelp.com/forum/jscrip...onhover.js (1.79 KB)
http://www.rockbandhelp.com/forum/jscrip...s?ver=1400 (5.18 KB)
http://www.rockbandhelp.com/forum/cache/...global.css (14.3 KB)

Just looking at what's there, Fit on Page and fBDock were plguins, I know that one (I uninstalled fBDock anyways), and the twimg are from a Twitter sidebar that they gave me, so those two are beyond my control, but what about the default few CSS files and my JS? Is there a way to work the compression system on MyBB already with those files?

Also seems like Alexa says I'm faster than 69% of websites.
If the site is that slow, it will primarily be a host issue.

It may also be a configuration / .htaccess issue. Your site should send proper cache headers for the static stuff (JS, CSS, images) so browsers will have to load them only the first time they go on your site. Once cached, there is no speed difference whatsoever between compressed combined JavaScript as opposed to what you currently have, as long as the code itself stays the same.

You can pretty much ignore the speed / performance measure in Google Webmaster Tools, what's MUCH more important is whether the site feels slow to actual users or not.

What you can do (for free) is download the Google performance Firefox plugin, it can automatically generate compressed / minimized versions of your CSS and JavaScript (and sometimes even images) at no loss of quality/functionality, and you can replace your files with the minimized versions. However MyBB will reformat the CSS every time you change the styles around.
I think the only .htaccess thing I have (period) is your Google SEO plugin, so I don't understand what will be so problematic about that.

And no, my site doesn't feel slow. It's noticeably faster than most vBulletin 4 sites.
Have you check all the link (image link) use /images/.. rather than http://www.forum/images/... ?
Try use this http://site-perf.com/
If your site is that slow i would recomend a few things:

1. YSlow for firebug (to see what you can speed up)
2. Smush It (Comress images)
3. CSS Compressor (To compress your css)
4. JS Compressor (To compress your JS)

If your unsure about compressing your css i have a file that may help, It compressess your css whle still uncompressed in the mybb css files.

As for the JS files i would run all local files through JS Compressor and put them all in one file, And maybe load ProtoType from Google.

Speeding up sites isn't my stong point so if anyone finds a problem with my suggestions please post.

Hope this helps speed up your site.
Alright, thanks anyways guys.

As I said, it could be just Google.
(2010-10-02, 09:12 AM)Damion Wrote: [ -> ]1. YSlow for firebug (to see what you can speed up)
2. Smush It (Comress images)
3. CSS Compressor (To compress your css)
4. JS Compressor (To compress your JS)

Big Grin