AJAX Optimisation

Soldato
Joined
18 Oct 2002
Posts
2,910
Location
London
I am currently developing a game which will work using AJAX.

It's a turn based game where every user has 90 seconds to take their turn (although it might not take them that long). There is up to 10 players per game.

I had thought that I could just have each client checking to see if the other players had played their turn by calling a page from the server every 5 seconds. This way play can be updated on a near live basis.

Games can take around 3 hours to complete. This could work out to be 21600 requests per game!

How should I look to optimise this? I have been looking in to stuff like Comet but not sure if I can implement it using PHP.

Any of the bright sparks here have any ideas?
 
Yeah, been looking at other games that run in a similar way to mine. I just need to engineer the way I had been building it - at the moment I have been loading a load of data each team even if nothing changes. I need to shift some of the processing on to the client as opposed to getting the server to render the pages to be displayed.

Back to the code...
 
Back
Top Bottom