Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Site Discussion >> javascript client image headers
(Message started by: Victorwss on Mar 5th, 2010, 5:24pm)

Title: javascript client image headers
Post by Victorwss on Mar 5th, 2010, 5:24pm
Hi.

I played some games with some invisible pieces in the javascript client.

That really sucks. The reason is because sometimes the browser request for some image timeouts and so the browser does not render it.

In the start of the game, this is not much a problem, because I can just refresh the page until it shows everything correctly. However sometimes, when the server is really badly overloaded, it may never work correctly. E. g.: In the first try it did not loaded the silver's cat. Refreshed the page, and this time the gold elephant does not shows up. Refreshed a third time and the board is not loaded. In the fourth time, the gold rabbits does not shows up. This is very bad. However, eventually all pieces (and the board) will show up and I can start to play.

BUT, when the server is overloaded, sometimes the client misses the other player's move. When I suspect that this occurred, I need to refresh the page, and normally the opponent moved some time ago and my time is running. To make things worse, some pieces (or the arrows icons, or even the board image) does not renders correctly and I need to do the browser-refresh ritual until it shows up, or try to play in that state anyway, with the time running! In fast and blitz games specially, this is a disaster.

I already had to unrate some games due to this problem and already blundered due to invisible pieces. So, at least for me, this problem is really annoying.

I started to investigate this, and saw that the images contains a particular header:


Quote:
Cache-Control: max-age=3600


The images used are static images and probably will never change, so this type of header is surprising. I think that forcing the browser to cache it always would be good.

Further, the generated <img> tags does not have the alt attribute. The alt attribute would be very handy when the images does not shows up.

And, if possible, the client should have a way to check automatically if the server already commited a possibly lost message without relying in the user refreshing the page. Though this may possibly overload the server even more.

Title: Re: javascript client image headers
Post by Hippo on Mar 7th, 2010, 4:53am
Yes, I agree with both time-out and alt-tag to be issues.

Having alt tags H for gold horse, d for silver dog ... would help much. One could even stop downloading images when having bad connection (I hope).

Title: Re: javascript client image headers
Post by omar on Mar 11th, 2010, 10:11am
I think the cache control header might be a default value that the web server uses. I'm not explicitly setting that.

I've made a note to add the ALT attribute to the IMG tags. Thanks for the suggestions.

Title: Re: javascript client image headers
Post by Hippo on Mar 14th, 2010, 11:32pm
When replaying game on xperia, I start loosing animal pictures and after a while I have board with alternate texts "Image". I hope the alternate tag will solve this problem. So I am looking forward for it. I thing EeMmHhDdCcRr would be ok as well as ge resp we ...

Title: Re: javascript client image headers
Post by Hippo on Jan 31st, 2011, 6:37am
I hope this feature proposal was not lost so I am popping it up ... . It allows replaying games started while connected without connection needed during replay. Especially usefull in underground.

Title: Re: javascript client image headers
Post by omar on Feb 1st, 2011, 12:08pm
I do have this in my todo list.

I just looked into doing this, but it is not as trivial as I thought it would be. Can you remind me about this after the events are over.




Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.