Charpane Avatar image keeps reloading

Think you've found a bug? Here's the place to talk about it. It might actually get fixed.

Moderator: Public Forum Moderators

User avatar

Topic author
Deo
Forum Addict
Posts: 194
Joined: Thu Apr 17, 2008 2:45 am
Location: Dublin, Ireland

Charpane Avatar image keeps reloading

Unread post by Deo » Fri Jul 18, 2008 9:32 am

I noticed there that every time you spend an turn the avatar picture reloads. Could the avatar not just load at login and save on server side resources?
Image

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Interface Ideas

Unread post by Gobberwart » Fri Jul 18, 2008 4:31 pm

Every time you spend a turn, the entire charpane reloads, but any images in there are (should be) cached by your browser and loaded from there rather than requested from the server. At least, that's what I see. What makes you think the avatar is being reloaded from the server every time?
Image

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Charpane Avatar image keeps reloading

Unread post by Gobberwart » Tue Jul 22, 2008 3:20 pm

I just realised that the original topic for this was in the pre-alpha forums, which are now read only, so it's no surprise I didn't get any responses.

Anyway, I happened to be looking over Elljae's shoulder while she was playing Paradox yesterday (I do that sometimes, I'm creepy like that), and noticed that the avatar image certainly did appear to be reloading from the server every time the charpane refreshed. In other words, instead of the image appearing instantly each time the charpane reloads, it was appearing blank and then loading as if it was a brand new, uncached image.

That was using Firefox 2.

So I ran a few tests under different browsers, monitoring the server logs all the while, and discovered that:

- Firefox 3 doesn't reload the image
- Firefox 2 doesn't either (very odd)
- Firefox 1.5 doesn't

- Internet Explorer 6 does reload the image
- Internet Explorer 5.5 does

- Safari 3.1 (Windows) does not
- Opera 9.51 does not

I don't have IE7 installed here at work, but I'll install it later and test that too.

As a matter of interest, here are some (slightly edited) log samples:

Using Firefox (any version):

[23/Jul/2008:09:49:50 +1000] "POST charpane.php HTTP/1.1" 200 7563
[23/Jul/2008:09:49:51 +1000] "POST charpane.php HTTP/1.1" 200 7563
[23/Jul/2008:09:49:57 +1000] "POST charpane.php HTTP/1.1" 200 7563
[23/Jul/2008:09:49:58 +1000] "POST charpane.php HTTP/1.1" 200 7563
[23/Jul/2008:09:49:58 +1000] "POST charpane.php HTTP/1.1" 200 7563

Using Internet Explorer 6:

[23/Jul/2008:09:52:28 +1000] "POST charpane.php HTTP/1.1" 200 7615
[23/Jul/2008:09:52:28 +1000] "GET /paradoxdev/phpThumb/phpThumb.php?src=share/images/avatars/jaH2WJqFCMD8KQcd3vw0Z516LmeyVAzt.gif&w=150&h=150&iar=1&f=gif HTTP/1.1" 200 12982
[23/Jul/2008:09:52:30 +1000] "POST charpane.php HTTP/1.1" 200 7615
[23/Jul/2008:09:52:30 +1000] "GET /paradoxdev/phpThumb/phpThumb.php?src=share/images/avatars/jaH2WJqFCMD8KQcd3vw0Z516LmeyVAzt.gif&w=150&h=150&iar=1&f=gif HTTP/1.1" 200 12982
[23/Jul/2008:09:52:31 +1000] "POST charpane.php HTTP/1.1" 200 7615
[23/Jul/2008:09:52:31 +1000] "GET /paradoxdev/phpThumb/phpThumb.php?src=share/images/avatars/jaH2WJqFCMD8KQcd3vw0Z516LmeyVAzt.gif&w=150&h=150&iar=1&f=gif HTTP/1.1" 200 12982

You get the idea.

Anyway this raises some interesting questions:

1. Why does this happen?
2. Why did it happen on Elljae's Firefox 2 and not mine (or on any version of FF I tested)?
3. Can I do anything to prevent it?

Further research is definitely needed, because continuous reloading of images is an amazing way to blow hell out of the monthly bandwidth allowance, and looks ugly too.

Deo, what browser do you use?
Image

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Charpane Avatar image keeps reloading

Unread post by Gobberwart » Tue Jul 22, 2008 3:49 pm

Update: I installed IE7 on my PC, and noted that the problem does not occur there.

I did have some confusing moments, however, because after installing IE7, suddenly IE5.5 and 6 stopped exhibiting the behaviour (I'm running them all on the same PC with this utility: http://tredosoft.com/Multiple_IE).

After further testing, however, it turns out that IE 5.5 and 6 will only have a problem initially, but on doing a page refresh (using the browser's "Refresh" button), the problem goes away for the remainder of that session and only comes back after restarting the browser.

Because THAT makes sense. Got to research this more.
Image

User avatar

Topic author
Deo
Forum Addict
Posts: 194
Joined: Thu Apr 17, 2008 2:45 am
Location: Dublin, Ireland

Re: Charpane Avatar image keeps reloading

Unread post by Deo » Wed Jul 23, 2008 1:15 pm

I seem to be saying this in a lot of threads....... What oh what have i started....!

Post Script; it's happening to me on firefox 2.
Image

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Charpane Avatar image keeps reloading

Unread post by Gobberwart » Wed Jul 23, 2008 6:25 pm

I've still not been able to replicate this on Firefox 2, despite trying a number of different things. My FF2 install is unmodified, but the modular nature of the browser means you guys could have any number of extensions and configuration changes that I don't have.

In any case, I found this page, which gave me some settings to try in Apache and which seem to have done the trick (on Internet Explorer at least) here. While I can't modify the Apache server config on our host (grumble), I should theoretically be able to put together a simple .htaccess file, upload it to the server tonight, and the problem *should* go away.

Assuming (ruh-roh):

- Our hosting provider has the mod_expires module loaded into Apache; and
- The problem in Firefox that I can't replicate is caused by the same thing as in IE.

I'll do it tonight when I get home and see how we go.

EDIT: Interestingly enough, this fix does absolutely nothing about the flickering drop-down menus in IE, even though the article would suggest that it does. That's a separate issue entirely, and one that's not going to be as easily fixed. If you're really keen, you can read this page for more on that one.
Image

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Charpane Avatar image keeps reloading

Unread post by Gobberwart » Wed Jul 23, 2008 6:38 pm

Or it might have something to do with this thing that I found in the "about:cache" page in Firefox:

Key: http://www.paradoxthemusical.com/phpThu ... ar=1&f=gif
Data size: 70800 bytes
Fetch count: 2
Last modified: 2008-07-24 13:48:50
Expires: 1970-01-01 11:00:00


See the "Expires: 1970..." thing? In addition to the fix above, which is still valid, I'll have to have another look at the phpThumb config to see if that's doing something silly.

EDIT: This is a symptom, not a cause :)
Image

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Charpane Avatar image keeps reloading

Unread post by Gobberwart » Wed Jul 23, 2008 7:02 pm

There's nothing obvious in the phpThumb config but you'll be pleased to know I've finally seen the problem happening in Firefox 3!

Also tested the Apache config changes mentioned earlier and saw the following:

Before changes

Expires: 1970-01-01 11:00:00

After changes

Expires: 2008-08-23 14:28:09


Looks promising.
Image

User avatar

ElljaeT
Developer
Posts: 739
Joined: Sat Jun 23, 2007 4:40 pm

Re: Charpane Avatar image keeps reloading

Unread post by ElljaeT » Wed Jul 23, 2008 10:15 pm

Just so you know, in case its relevant I'm running FF 2.0.0.16

User avatar

Gobberwart
Developer
Posts: 3396
Joined: Wed Jun 20, 2007 12:41 am
Location: Melbourne, Australia
Contact:

Re: Charpane Avatar image keeps reloading

Unread post by Gobberwart » Wed Jul 23, 2008 10:20 pm

I've put the change into (proper) dev and tested ok, so I've uploaded it to production. Guys, please let me know if the problem is still occurring.
Image

User avatar

ElljaeT
Developer
Posts: 739
Joined: Sat Jun 23, 2007 4:40 pm

Re: Charpane Avatar image keeps reloading

Unread post by ElljaeT » Wed Jul 23, 2008 10:24 pm

Looks good to me so far :-) no problems here

User avatar

Topic author
Deo
Forum Addict
Posts: 194
Joined: Thu Apr 17, 2008 2:45 am
Location: Dublin, Ireland

Re: Charpane Avatar image keeps reloading

Unread post by Deo » Sat Jul 26, 2008 1:55 am

Working perfectly now on my end too. Good job!
Image

Post Reply