JavaScript not changing.

Discussion in 'Install/Configuration' started by Matthew_K, Apr 5, 2008.

  1. Matthew_K

    Matthew_K New Member

    I'm not sure why or how, but for some very odd reason my java isn't changing.

    I have a search routine that works fine in all browsers except IE (of course) and returns Undefined for IE. Not a problem. So I went into my Java to trouble shoot it, changed a few things, and went to test. Same result. After doing this for a while I decided to add an alert() to the function to check if something is being triggered... No alert was fired. So at this point, I'm thinking that there is a duplicate script or function name somewhere. There isn't. I've commented out the entire function and it still is unchanged. I opened up the page in a fresh browser and it STILL isn't changed... So now I think it's a static files that's been cached by the server and the server doesn't want to let go of it.

    Any thoughts?
    Thanks,
    Matt.
    Edit/Delete Message
  2. mistwang

    mistwang LiteSpeed Staff

    Please try a command line tool to download the script like

    lynx -mime_header URL
    wget URL

    LSWS should update its cache when a file has been changed. Sometimes browser caches it.
  3. Matthew_K

    Matthew_K New Member

    I know. I tried a fresh browser that had never been to the page (safari) and then tried Opera 9 (which was also new to the page). But I went to the script directly www.example.com/thescript.js and it came up with the modified version!
  4. Matthew_K

    Matthew_K New Member

    After disabling GZIP, all my JavaScript files changed to what they should be now...

    Any suggestions? Honestly, I don't need gZip compression yet. But as the site starts taking on more and more bandwidth draws, gZip would be nice.
  5. mistwang

    mistwang LiteSpeed Staff

    You have to clear the browser cache if you test it using browser.
  6. Matthew_K

    Matthew_K New Member

    I did... And like I said, I tried different browsers that had never been to that page. I was also being paranoid and tried it from a fresh Windows XP install on a virtual machine and there was no change. But like I said, after removing GZip compression, the new java was working fine.

    Note that changes made to any PHP or HTML went through fine. Only JavaScript was an issue.
    Last edited: Apr 7, 2008
  7. mistwang

    mistwang LiteSpeed Staff

    Probably is a problem with the gzip cache. We will check.
  8. Matthew_K

    Matthew_K New Member

    Sounds good. Glad you're on it. Let me know if you need any help for testing or anything.
  9. mistwang

    mistwang LiteSpeed Staff

    LSWS update gzip cache based on the timestamp of the origianl file and the gzip file in the cache. So, you can check the modified time of that java script file, if it has been changed, the gzipped file should be changed as well.

    Try
    "touch <javascript file>"
    to update the timestamp.
  10. Matthew_K

    Matthew_K New Member

    touch? I've never heard of that. How do you do that?
  11. mistwang

    mistwang LiteSpeed Staff

    That's a standard unix command, try it from command line

Share This Page