homepage Welcome to WebmasterWorld Guest from 54.205.189.156
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
problem updating js files on web
transqulient




msg:1481802
 11:23 am on Apr 3, 2003 (gmt 0)

Hi guys,

I have a problem updating scripts files on the net.
I use WS_FTP and try to update a .js file with the same filename.
The results are: filename is updated on the web server
but the page is acting with the old script.
Is the web server somehow caching the script file?

 

dcheney




msg:1481803
 11:53 am on Apr 3, 2003 (gmt 0)

Many browsers seem to cache .js files and don't reload them if you select refresh. When I'm doing testing I just put the full path to the .js in the browser - that'll probably show you the old version. Hit refresh. Now you should see the new version and the new version should now be used when you go to a html page that calls it.

joshie76




msg:1481804
 12:18 pm on Apr 3, 2003 (gmt 0)

Most browsers will do a FULL refresh (i.e. re-download all content) if you hold CTRL and refresh.

Some ISPs do actively cache files - you'll need to speak to them to see if they do this.

<edit>corrected silly typo: cash => cache, oops</edit>

[edited by: joshie76 at 1:00 pm (utc) on April 3, 2003]

transqulient




msg:1481805
 12:23 pm on Apr 3, 2003 (gmt 0)

The problem still exists
I cn;t actually replace the old file.
When i go to my web script directory time changes but the file is still the old one.

It's like the web server doesn;t update script files with the same filename or something.

Thanks for the reply.

joshie76




msg:1481806
 12:26 pm on Apr 3, 2003 (gmt 0)

I've noticed something similar when using WS_FTP now you mention it.

Make sure you press the 'refresh' button for the left hand window before you do the upload.

Let us know how you get on. I'd be amazed if the web server specifically stopped you updating .js files - it doesn't make any sense.

transqulient




msg:1481807
 12:37 pm on Apr 3, 2003 (gmt 0)

Fixed in a weird way,
Full details:
I have a web page on geocities.com
1.When i go to my script directory the file seems the same (old) either downloading it or view it online
2.When i go through the web folder manager through the geocities web page the file is the new one.I refresh the screen in my web page...still the old one.
3.I download the script file using the upload manager(web-based) It works!

Damn, if i have to do this every time i want to change something it will take ages.

I had this problem a few weeks now, and i had to change all the script references and script names to have a result.
I have the same problems with images files aswell but never with html files.
Thanks for the help guys. Have any idea if this is a WS_FTP prblem or a web server problem?

joshie76




msg:1481808
 12:48 pm on Apr 3, 2003 (gmt 0)

I doubt it's down to WS_FTP (though you could always just try the IE ftp functionality and see if it works then) - WS_FTP is a great product, I've just noticed that I have to refresh the source window occasionally ;)

I have no experience with Geocities though I think such odd behaviour isn't totally uncommon with free webspace.

Best of luck

Josh

transqulient




msg:1481809
 12:57 pm on Apr 3, 2003 (gmt 0)

I used the same technique with an image aswell and it works on my computer. I erased all the internet temp files on my computer and the image was updated.

The website is not free, i pay each month to have a registered name and extra space. And ofcource the ability to have FTP access. Cause the free ones don't have this feature like they used to be.

I looked on another computer but the image there is still the old one. I'm confused.

Anyway thanks for the help josh.

aspdaddy




msg:1481810
 1:08 pm on Apr 3, 2003 (gmt 0)

I had the same problems with jpegs when I was replacing logos.

I found this script but I couldnt use on a Windows server, but apparantly it will do the trick, maybe you can do the same with .js

Map jpeg extensions to this script
open(JPG,$ENV{PATH_TRANSLATED});
binmode JPG;
$JPG= join "",<JPG>;
close JPG;
binmode STDOUT;
print "Content-Type: image/jpeg\r\n";
print "Content-Length: ${\(length $JPG)}\r\n";
print "Cache-Control: no-cache, must-revalidate\r\n";
print "Pragma: no-cache\r\n\r\n";
print $JPG;

g1smd




msg:1481811
 10:43 pm on Apr 3, 2003 (gmt 0)

Delete the old file on the server, or rename it as .old or something, before uploading the new one. Then you can be absolutely sure that the file on the server is the correct one.

transqulient




msg:1481812
 10:15 pm on Apr 4, 2003 (gmt 0)

Even if i delete the file the server thinks its there.It still shows the image even if i refresh the page.The file does not exist in the ftp but the page still loads the old image.

The only thing that works is to upload the file from the web based upload of the WEB provider(Not through FTP).And then to open and refresh the image/script in the images/scripts directory.

Weird

joshie76




msg:1481813
 7:35 am on Apr 7, 2003 (gmt 0)

Sounds like geocities are using server caching then - which is programmatically cleared if you use their web based upload thingy.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved