PDA

View Full Version : the js file get cached so I cant update it



Dennis_Gull
07-12-2007, 08:39 PM
Hello, im just running in to a problem when I try to work with my javascript. When I make a change and then update the page the js code is still the same. In FF I just run the actual js file and then update it but in IE it will download the file as soon as I try to run it. Is there a way to fix this problem? its kinda annoying.

Trinithis
07-12-2007, 08:48 PM
Hit F5 (reloads page and cache)

jscheuer1
07-12-2007, 08:48 PM
Generally, all that is required is that you refresh the page and changes to its attendant script(s) will be recognized. However, in some cases you must first clear the browser's cache. In rare cases the server may have cached the script and you will need to wait until that is cleared. It may be an hour or a day. This is really rare though, and completely under the control of your host. Even when your host is set up this way, I doubt that they would ever cache material of this sort for more than one day.

One other thing to consider, make absolutely sure you are updating the right file.

mwinter
07-12-2007, 09:05 PM
In rare cases the server may have cached the script and you will need to wait until that is cleared. It may be an hour or a day. This is really rare though, and completely under the control of your host. Even when your host is set up this way, I doubt that they would ever cache material of this sort for more than one day.

Even if a resource has freshness meta data associated with it causing user agents to serve a cached version until it's considered stale, a client can still demand an up-to-date version. As I recall, one can do this by pressing Shift+F5 in IE.

Dennis_Gull
07-12-2007, 11:47 PM
I kinda know how to work with it now, I just have to restart the browser in IE to get it to work, shift+ F5 didnt work for me thought. anyways thanks for the reply :)

jscheuer1
07-13-2007, 03:25 AM
Sounds like a javascript session cookie. I so, you could alternatively delete cookies.

djr33
07-13-2007, 05:06 AM
If the script is in an external file, you could load that directly in your browser and hit f5. With images, at least, that is more effective than reloading the page in which it is embedded.

jscheuer1
07-13-2007, 05:12 AM
If the script is in an external file, you could load that directly in your browser and hit f5. With images, at least, that is more effective than reloading the page in which it is embedded.

You cannot load a .js file directly into IE, at least not without modifying IE's default configuration. Perhaps, not even then.

mwinter
07-13-2007, 06:03 PM
I kinda know how to work with it now, I just have to restart the browser in IE to get it to work, shift+ F5 didnt work for me thought.

Sorry, the key sequence is actually CTRL+F5. I should have checked before to make sure.

djr33
07-13-2007, 09:16 PM
Sorry. I haven't used IE much for some time, so I forgot just how bad it is :p