Link to home
Start Free TrialLog in
Avatar of Donelson
Donelson

asked on

Javascript to clear IE cache?

At our Explore the Taj Mahal and Explore Kew Gardens CD-ROMs, we offer quite large panoramas, some as big as 30 Mb each.

The problem is, the caching of these images seems to be persistent, no matter what HTML or PTviewer (pano engine) settings I make. This fills up RAM on the PCs and then performance slows to a petrified crawl.

I need a way to keep the cache of these images from building up, or a way to clear the IE cache...

Is there a way to clear the IE cache via Javascript? Or some other way?

Thanks


Regards,
William Donelson
Avatar of avner
avner

There is no way to clean IE cache (the only way is to delete the temp direcroty but this can only be done by the local machine.

The cache should not build up if you are limiting the size of the cache on the browser :
Tools>Internet Options >Settings.

Avatar of knightEknight
You can prevent the images from being cached by adding a random number or date to the src url.  For example:

<SCRIPT language='javascript' >
  var myImage = new Image();
  myImage.src = "/images/myImage.gif?rand=" + Math.random();
</script>

or from the server like this:

<IMG name='myImage' src="/images/myImage.gif?rand=<%=rnd()%>" />

(this is a ASP example)

You can also use the Time() function or some other function that will return the time in milliseconds since Jan 1, 1970 (for example).
Avatar of Donelson

ASKER

KinghtEknight

Thanks for your message. I am using PTviewer, a java applet that reads an encrypted jpg file and displays it as a perspective corrected pano.

you can see the source code at
  http://www.explore-kew-gardens.net

Just click on a small or medium sized pano, and then look at the source code.

How would I implement your suggestion in this case?

Thanks
William Donelson
We are planning lots more products which will have the same RAM-overflow problem.  Can anyone create a Java applet, or some such which can clear the IE cache?

I've increased the point value for this question.
Donelson , the Cache should not build up.

I'm not sure you can write a code to delete Ie's cache automatically since the content resides on a dynamic directory that.

I think your problem is with the cache being oversized and this is the problem that needs to be fixed, deleting the cache(if possible) would be an ugly a work around and not a prefered solution.

Can you try and post some code to try and better explain the problem ?
Please go to our Explore Kew Gardens

  http://www.explore-kew-gardens.net

For full access, use -
  Visitor ID: guestuntil28feb03
  Password:   ---- No password needed, just type
  in the ID above and click "Submit"

The problem is not the Disk Cache, but the RAM Cache used within the Virtual Memory process.  With the large 1 MB panos (25 MB decompressed) which we use on the CD-ROM version, once the RAM is filled, then the thrashing back and forth from disk to RAM begins, and this is V E R Y very slowwww. You can hear the hard disk thrashing away.

Panning around a big pano once this happens is painfully slow.

Because the 300KB medium panos (5 Mb decompressed) which are online are relatively small, it takes a lot of these to fill up your RAM. In fact, the online version does not provide enough medium panos to actually fill up the RAM on most PCs.

in the <HEAD> section I have:
<META HTTP-EQUIV="pragma" CONTENT="no-cache"><META HTTP-EQUIV="expires" CONTENT="Sun, 1 Jan 12:00:00 GMT">

In the PTviewer (Java Applet) calling code, I have:
<APPLET CODE="ptviewer.class" WIDTH=528 HEIGHT=352>
<PARAM NAME=CODEBASE    VALUE="../pvr/">
<PARAM NAME=ARCHIVE     VALUE="../pvr/ptviewer.jar">
<PARAM NAME=CACHE       VALUE="FALSE">
<PARAM NAME=CURSOR      VALUE="MOVE">
<PARAM NAME=PAN         VALUE="-123">
<PARAM NAME=FOV         VALUE="72">
<PARAM NAME=WAIT        VALUE="../pvr/0002wait.jpg">
<PARAM NAME=FILE        VALUE="../pvr/0002_40M.jpa">
<PARAM NAME=QUALITY     VALUE="3">
<PARAM NAME=BARCOLOR    VALUE="223377">
<PARAM NAME=BGCOLOR     VALUE="000000">
<PARAM NAME=BAR_HEIGHT  VALUE="15">
</APPLET>


The Param Cache, value False should prevent caching, and the HTML and Java call above probably DO prevent caching to disk, HOWEVER, this does not fix the horrific Virtual Memory pain.

Any ideas would be appreciated

Regards,
William Donelson
Still looking for a solution here...

Thanks
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpazMODic
SpazMODic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial