Jun
08

Chat Systems and RSS

By: tweekgeek
I've been neglecting this blog, obviously, but I've got some goodies coming up in the next version of the site that I've been promising, and I just realized that I should probably post somethig regarding them.

If you've ever come across my main blog: http://kassemi.blogspot.com, you've probably seen that I'm working on a new server project, one designed strictly for ajax requests... Instead of processing sessions and cookies (it does a little, but not much), it can send very simple HTTP responses through it's own dedicated connection. Here's a simple HTTP query:

Your browser sends this:

GET /some/page HTTP/1.1
User-Agent: Your browser's name
Remote-Addr: blah
Referer: blah
....

Where .... is just a whole load of different lines. Each of these lines in any normal server is processed, and although it doesn't take much time, it does take a little more than NOT processing it, obviously. It is then the responsibility of the server to maintain the connection with your computer and send the requested data through a socket to your page... This data will take on a format similar to this:

HTTP/1.1 200 OK
Date: The date sent.
Content-Type: text/html
Content-Length: 325 bytes
Last-Modified: Date last modified
....

Where the .... again means that there can be more data in addition to what was already sent. With AJAX these requests can be happening very frequently, and not all the information is necessary. In fact, when it comes to an application that polls for information (such as the chat room that I'm making right now), your server can be overloaded with these tiny requests. To avoid this from happening, I decided to make a server that will respond to these smaller requests a little quicker and with less bandwidth by sending only the necessary headers. I can't fix what your computer is sending me, but take for instance that first request I just showed you. The only information I really need from that for most purposes is the address:

GET /some/page HTTP/1.1

And that's the only information this server will even try to process. In so far as the response is concerned:

"
HTTP/1.1 200 OK
Content-Type: text/html

Lots and lots of data!
"

By doing that, I'm able to send out about 4 times as many requests as I can via a more traditional server.... And the great part? It works! And it works well. I've simply attached it to the cherrypy server that serves up the normal requests, and it will serve all requests that come into a specified port (which I've got mapped via apache rewrite, as we ARE behind apache in the first place).

Along with the chat room on the new server, I'm making a whole lot of updates to the system itself by writing a new barrage of unit tests to make sure we remain stable, and by removing a few of the more "prone-to-error" components.

Stick around, hope you'll enjoy!

Comments

About tweekgeek

I'm the (sole) programmer for MatchSTD.com. If you're using something on this site, I had something to do with it. Period. :)

About James' Blog

The first blog on the site. Rightfully belonging to the person who created the system.

Recent Posts

More updates planned
Server downtime
Proposals enhancements
Internal Server Errors
Chat fixes
Coming up...
BETA2 Released
Chat Systems and RSS
The new update
First Entry

Views and opinions expressed in these entries do not necessarily reflect those held by MatchSTD.com, it's owners, or it's affiliates..