Results 1 to 10 of 10

Thread: the js file get cached so I cant update it

  1. #1
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default the js file get cached so I cant update it

    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.

  2. #2
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    Hit F5 (reloads page and cache)

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    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.
    Mike

  5. #5
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Sounds like a javascript session cookie. I so, you could alternatively delete cookies.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by djr33 View Post
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Dennis_Gull View Post
    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.
    Mike

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sorry. I haven't used IE much for some time, so I forgot just how bad it is
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •