Closed Thread Icon

Topic awaiting preservation: IE cache problem Pages that link to <a href="https://ozoneasylum.com/backlink?for=21380" title="Pages that link to Topic awaiting preservation: IE cache problem" rel="nofollow" >Topic awaiting preservation: IE cache problem\

 
Author Thread
bigredswitch
Obsessive-Compulsive (I) Inmate

From: Silicon Scally, UK
Insane since: Apr 2004

posted posted 04-16-2004 10:43

Hi!

I've noticed a problem with a game I'm working on, which only occurs occasionally and never to myself. Here goes: the code should load a bunch of images, cache them, theoretically, then pull them from disk every time they are reused; looking through the server logs this isn't always the case. Once in a while some machine (always Win IE, multiple versions) will reload each image every time it is used, slowing down the draw time and pushing up my bandwidth use. Any pointers on this would be appreciated.

Thanks,

Carl.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-16-2004 17:27

Yep, you can't fix this. If the user has their preferences set to "check for newer versions of a page" (Tools>> Internet Options >> Temporary Internet Files >> Settings ) then image caching is turned off.

Many developers (myself included) use this setting because you never have to worry about cached images.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-16-2004 17:41

though you could do some server side trickery, and present the user with a 'change your cache settings, or don't play this game' message...

bigredswitch
Obsessive-Compulsive (I) Inmate

From: Silicon Scally, UK
Insane since: Apr 2004

posted posted 04-16-2004 18:02

I have my browsers (IE5.2, Moz 1.7, Safari 1.0 on OS X; IE6, Moz 1.7 on Win2k) set to reload the page every time too, in which case the images are loaded just once per page, but every page load/refresh. The occasional problem with Win IE comes from where one image may be used 50 times in the page, and IE will load that image 50 times from the server (meaning each room takes a long, long time to display). But not on my machines, for some reason! It's not happened so far today, according to the server logs.

The change between each room should be almost instant - if it's not I'd really like to hear from you.

Carl.

(Edited by bigredswitch on 04-16-2004 09:07)

Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 04-18-2004 10:39

In order to avoid a browser cache, you can add the following server side code:
In JSP file

code:
// Clear cache
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-control", "no-cache");
response.setDateHeader("Expires", 0);



In ASP file

code:
<SCRIPT RUNAT=SERVER LANGUAGE=VBScript>
' This next procedure will stop any browser cache, even if it is set
' to "Never", the page will be re-downloaded. This also works if that
' page is re-visited using the back button in the browser.
' To use it you must call this as the first thing in your page
' since it add headers, and if your page has buffer=false
' this will cause an error if it is not done before anything else.
sub disableBrowserCache()
response.expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma","no-cache"
response.addHeader "cache-control","private"
Response.CacheControl = "no-cache"
end sub
</SCRIPT>

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-18-2004 11:21
quote:
In order to avoid a browser cache,[...]



which is exactly the opposite of bigredswitch's goal.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-18-2004 22:28

I should also say I didn't have a problem playing. And my cache is off.

But I'm still pretty sure this is a browser issue not something easily (or even if it's possible ) fixed via JS code.

Breaking caching can is relatively easy. Forcing it on hmm...

bigredswitch
Obsessive-Compulsive (I) Inmate

From: Silicon Scally, UK
Insane since: Apr 2004

posted posted 04-19-2004 13:25

"I should also say I didn't have a problem playing."

And that's my problem! According to the logs it's not happened of late, but only about 20 people have looked at it. My earlier game currently gets about 2000 players a week and out of those 50 or so appear to experience this. I think the solution, unfortunately, will be to detect the happening (by timing the level/screen load) and informing the user. Oh well!

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-19-2004 13:31

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu