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?


William Donelson
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

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();

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).
DonelsonAuthor Commented:

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

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?

William Donelson
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

DonelsonAuthor Commented:
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 ?
DonelsonAuthor Commented:
Please go to our Explore Kew Gardens

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=ARCHIVE     VALUE="../pvr/ptviewer.jar">
<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">

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

William Donelson
DonelsonAuthor Commented:
Still looking for a solution here...

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.

EE Cleanup Volunteer
PAQed, with points refunded (500)

EE Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.