?
Solved

Javascript to clear IE cache?

Posted on 2003-03-24
9
Medium Priority
?
615 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:Donelson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 14

Expert Comment

by:avner
ID: 8194586
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.

0
 
LVL 33

Expert Comment

by:knightEknight
ID: 8194907
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).
0
 

Author Comment

by:Donelson
ID: 8195175
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Donelson
ID: 8221001
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.
0
 
LVL 14

Expert Comment

by:avner
ID: 8233101
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 ?
0
 

Author Comment

by:Donelson
ID: 8233451
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
0
 

Author Comment

by:Donelson
ID: 9625776
Still looking for a solution here...

Thanks
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10149651
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
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 10204370
PAQed, with points refunded (500)

SpazMODic
EE Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question