Forum Moderators: rogerd

Message Too Old, No Replies

How Important are Light-weight Forum Pages?

         

rogerd

1:55 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I just spent a couple of weeks on a ship with a slow, expensive satellite-based Web connection. I have to admit that WebmasterWorld was one of the few sites that operated nearly normally under the slow connectivity conditions I experienced.

I've worked to keep pages light in other forums I manage, though I'll admit that none are as light as the pages here. Since I'm almost always connected by broadband with a few megs of bandwidth, and general broadband use is way up in the US, I know that I haven't worried about this issue as much as I used to.

Still, one characteristic of forums is a high number of page views per user - if a forum's pages are frustratingly slow to load, it's possible that some users will seek out less irritating sites.

How important do you think keeping your pages light is? What kinds of steps have you taken, if any, to achieve this objective?

trillianjedi

2:14 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Great topic Roger (welcome back too ;)).

How important do you think keeping your pages light is?

Speed is everything. It's extremely important.

Steps you have taken

Core Software Code Changes

1. Many small square graphics can be replaced with HTML.

2. Remove Avatars feature.

3. Remove all superfluous database junk ("we have X users online" type stuff). Make sure you don't just remove it from template files - take it out the core code.

4. Remove all white space from HTML page templates.

5. Remove all Javascript.

Server Config Changes

1. Move all .htaccess rewriting into httpd.conf. Keep as small an .htaccess as possible. It's loaded by every thread prior to processing every request.

2. Cache everything that's cachable with a long shelf-life (make sure you're caching your forum image files).

Miscellaneous

Want to know why many CSS converts keep saying to Brett "put it in an external CSS file!" and he doesn't do it? That's because the fewer external file accesses you have (the less objects loading), the faster everything works.

The average WebmasterWorld page has 4-7 objects per page. That's it. That's a fundamental reason for the speed here - it's actually a lot quicker to shove it all in one file and live with a few extra bytes, than run another httpd thread and server request.

Examine your pages to see how many objects are required to load in order to render the page. That's one object for every image, every .js file and every other externally referenced "thing". Reduce that as much as possible, at the expense of a few extra bytes in the page source if necessary.

phpBB2 averages about 27 objects to the page last time I looked. Reducing that makes for significant speed improvements.

If you have an external CSS file I am told that putting graphics into the external CSS where possible (for cell backgrounds etc) means the browser will cache them properly without re-requesting, although I've never tested that.

Testing

A little PHP code in your header and in your footer and you can have a timer that displays page build time to admins/mods or selected parties. Measuring results is important when doing attempting any kind of speed improvements. Tweak and check, tweak and check. Make sure you take an average of 4/5 readings to allow for high/low server loads.

Once you have your page build time below 0.5 second (that's really really easy to obtain even on a busy forum) bear in mind all the rest of the delay is going to be down to those http object requests and the quality of the backbone that your host is on.

TJ

[edited by: trillianjedi at 4:05 pm (utc) on Oct. 9, 2006]

rogerd

4:00 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Wow, TJ, great tutorial on eliminating bloat!

I agree completely with eliminating non-essential "stuff". Today's feature-rich forums come packed with all kinds of things that may have some "cool" factor but take up bandwidth and CPU time with little enhancement of the user experience.

jtara

8:58 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Want to know why many CSS converts keep saying to Brett "put it in an external CSS file!" and he doesn't do it? That's because the fewer external file accesses you have (the less objects loading), the faster everything works.

While I applaud the largely-successful efforts to make WebmasterWorld a light-weight site, this one is nonsense.

If you have a site-wide CSS sheet, it is accessed ONCE when you first access the site, then cached. And then it eliminates the need to include style elements in the text.

On the other hand, you then have to include references to the styles. Given the light use of styles here, it wouldn't offer much of an improvement.

But it would give a lot of layout flexibility, and seperate content from style.

FWIW, I've been playing with the MODx CMS a bit lately. It produces incredibly clean HTML output (only NECESSARY class and id tags, unlike some other CMSs such as TYPO3 that emit them whether needed or not), pretty CSS/Javascript eye candy, and positively zips. Yet, open a MODx site with Lynx, and it's perfectly understandble and accessible.

The best of both worlds.