MyBB Community Forums

Full Version: Page Speed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I recently noticed that my board was running a little slow, and did some checking about on the internet for tools to help me fix it.

I got the Page Speed plugin for firefox and ran it on my mybb forum, and nearly fell off my chair.......

Here is some data from my Showthread (not hugely customised)

JS - Combine external JavaScript
There are 16 JavaScript files served from www.leefish.nl. They should be combined into as few files as possible.

* http://www.leefish.nl/jscripts/general.js?ver=1600
* http://www.leefish.nl/jscripts/highlight.js
* http://www.leefish.nl/jscripts/inline_mo...s?ver=1600
* http://www.leefish.nl/jscripts/popup_menu.js?ver=1600
* http://www.leefish.nl/jscripts/prototype.js?ver=1600
* http://www.leefish.nl/jscripts/thread.js?ver=1600

6 of them are mybb required files....

JS - Enable compression
Compressing the following resources with gzip could reduce their transfer size by 161.4KiB (72% reduction)

Pretty much the same files as in the first list.


Minimize request size
The requests for the following URLs don't fit in a single packet. Reducing the size of these requests could reduce latency.

Example:

# http://www.leefish.nl/cache/highlight.css has a request size of 1.9KiB

* Request URL: 46B
* Cookies: 1.3KiB (note that this is a static resource, and should be served from a cookieless domain)
* Referer Url: 50B
* Other: 514B

So it seems I have three big problems here - one could be solved by combining the js.files (which I don't know how to do) - advice/help requested.

I have GZIP enabled on my board - should I compress the files more using an online compressor?

Most concerning (I thought) is the request sizes, due to the cookies. Even if I compress then the cookies will still be there. So I looked up how to deal with this cookie issue.

But I now have a problem - I followed this advice in the general configuration page of MYBB:

Cookie Domain
The domain which cookies should be set to. This can remain blank. It should also start with a . so it covers all subdomains.

This appears to have been a BAD move - it seems that my whole domain is now cookiefied and now in order to serve these files from a static domain and get that request size down I need to buy a new domain???

I would like to try and speed up my board by optimising the performance rather than removing features, and any help on how I can go about doing that is appreciated.

Cookies cannot be compressed and will be sent on every request. I wouldn't worry of it being only ~1KB.

Enabling GZip compression in MyBB only affects PHP scripts, it doesn't affect static resources such as Javascript and CSS. You should use mod_deflate (or similar) for that functionality - you may need to contact your host about that. Alternatively, you could use mod_rewrite and manually compress your Javascript, using rewrite conditions to redirect users to the GZipped versions if their browser supports it.
Javascript can be combined, usually, by simply concatenating the files (joining them all together). However, do be cautious of scripts which aren't loaded on every page.
You can further reduce size by minifying Javascript. There's also a JS compressor, but I would refrain from that and just minify, and then serve GZipped versions.

Do note that Javascript files are generally only downloaded once per visit so will usually only affect the first page load - subsequent visits by the user will usually have these files cached.
Also, you can edit your .htaccess file to pass CSS files through a minimiser (and gzip it if need be).

As for serving static content, I did manage it before, but I cant remember exactly how. Ill see if I still have the backup for my old board.
Javascript does not reduce the speed too much, since hosted and place on your server.
Just like Yumi said, It will cache by all browser.
It different, if your JS hosted outside your forum. For example from Google API.
I did some experiment with that kind of speed tools with little change performance.
- use optimized image
- Gzip activated (optional), small resources required
- Setting to NO for "Send Standard Headers and Send No Cache Headers"

Actually, MyBB is well optimized and lightweight