We help IT Professionals succeed at work.

Internet Explorer 8.0 Cache Problem

Medium Priority
326 Views
Last Modified: 2012-05-11
I am having a bizare problem.  I am running Windows XP and have IIS 6.0 installed and running.  This is my delvelopment environment.  I have a website that I am having a problem with caching.  I have a web page that is referencing a .js file.  The problem I'm having is that the .js file is loaded in a cache somewhere and is not being updated as I make changes to it.  

Scenario
================
I started out with a simple function in my .js file (test.js) that contains the following:
function AssignPSIDs()
{
   alert("In AssignPSIDs");
}

I have a webpage that uses XSL and XML.  The XSL  has a reference to my test.js file.  In my XSL, where i make the call to AssignPSIDs, I get the alert.

Now I go in and change the function to do what I really want.  When I run the webpage and click the button, I still get the alert -- it is not executing my new code.  If I look at the .js file, the new code is there.  However, if I debug the webpage using InterDev 6.0, the test.js script shows in the list of files loaded for the process but when I open it, it has the old script info, ie. the alert.

I am using IE 8.0 and have cleared my cache using Internet Options -> General ->Browising History -> Delete.  I have exited and restarted the browser.  Nothing seems to work.  

Any ideas?
Comment
Watch Question

as a test try
<script src="test.js?test=1" />
if that works, then you are right about the caching.
and you can use some js to append new date and time as a ?nocahe='+new Date().getTime();
this will append a timestamp

Good Luck,
Ernie
Top Expert 2007

Commented:
Restarting IIS will also do the trick.

Author

Commented:
Tried restarting IIS and even restarted the whole PC and still the problem is there.

Author

Commented:
The problem may reside within IIS.  I turned on the option to display ASP errors instead of the standard error that my IIS was setup with for my application and the ASP errors are not being displayed, only the standard error.  I have restarted IIS and even rebooted the machine several times and I still can't get it to work.  Any other thoughts?
Top Expert 2007

Commented:
Include these in your HTML page

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="0">

From http://www.i18nguy.com/markup/metatags.html#expires

Author

Commented:
Discovered the problem but still don't know why.  Turns out I am using localhost in my url (this is on a development machine).  I have a hosts file with a valid entry for localhost.  I don't know where localhost is resolving but if I use my machine name instead of localhost, everything works fine.  If anyone has any ideas they would be appreciated.  
Top Expert 2007

Commented:
Copy the HOSTS file to "HOSTS_OLD", then remove all un-commented lines from the HOSTS file.
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
No further response from the experts.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.