Beer makes stuff better!

Blimey, things are getting busy here at CoolSmartPhone. Over the weekend the server was getting really busy. It’s not so much the loading, but more to do with my “screw it, that’ll do for now”-attitude to PHP scripting. Luckily, after a few beers, I had a flash of inspiration and I’ve recoded pretty much all of the front page. The front page is a monster – memory and CPU hungry in every way. Each one of those “blocks” you see on the front page (like “New Forum Posts”) is 10 seperate MySQL queries. It might not sound much but, when your realise that there’s around 15 of these blocks it all adds up.

Oh, and let’s not forget that the front page also loads all the latest news items too. Oh, oh, and there’s the minor fact that hundreds upon hundreds of people are trying to load this all at once. So yes, you can see… it presents some “problems”.

I’ve got a fairly fast connection here and, through my work I’ve got an even faster one, however I was constantly finding that the front page took.. well… ages to load. In Internet Explorer you’d be staring at a blank screen for what seemed like minutes. Not good, not good at all.

So, after a few beers I figured a way around it. It was a little complicated, and lord knows it’s not something I want to ever do again, but you should hopefully find that the front page and all other pages now load like a dream. :) I’m still keeping things crossed that my “slight less rubbish than normal” scripts don’t fall over. :)