[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Internet Explorer 8.0 Cache Problem

Posted on 2011-04-27
Medium Priority
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.  

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?
Question by:dyarosh
  • 5
  • 3

Expert Comment

ID: 35477372
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,
LVL 29

Expert Comment

ID: 35477708
Restarting IIS will also do the trick.

Author Comment

ID: 35477771
Tried restarting IIS and even restarted the whole PC and still the problem is there.
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.


Author Comment

ID: 35483645
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?
LVL 29

Expert Comment

ID: 35483733
Include these in your HTML page


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


Author Comment

ID: 35483841
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.  
LVL 29

Expert Comment

ID: 35484175
Copy the HOSTS file to "HOSTS_OLD", then remove all un-commented lines from the HOSTS file.

Accepted Solution

dyarosh earned 0 total points
ID: 35502215
I have found a solution but don't know why.  I have to delete cookies and temporary internet files everytime I make a change to my javascript file.  If I do that and reset IIS then it works.  Don't understand why but just happy that I have a solution.

Author Closing Comment

ID: 35726840
No further response from the experts.

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This article discusses how to implement server side field validation and display customized error messages to the client.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses

873 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