Re: stringWithContentsOfURL doesn't load the updated file
Re: stringWithContentsOfURL doesn't load the updated file
- Subject: Re: stringWithContentsOfURL doesn't load the updated file
- From: m <email@hidden>
- Date: Tue, 1 Apr 2003 14:24:19 +0100
Here's what I use:
NSMutableString* urlString = [NSMutableString stringWithCapacity:100];
[urlString setString: myURL];
// append a "?2345" where 2345 is actually a random number; forces
// proxy servers to fetch a fresh version of the file.
[urlString appendString:@"?"];
[urlString appendString:[[NSNumber numberWithLong:random()]
stringValue]];
webString = [NSString stringWithContentsOfURL: [NSURL
URLWithString:urlString]];
Works well.
_murat
On Tuesday, April 1, 2003, at 01:43 PM, j o a r wrote:
It probably remembers the url:s it has loaded and returns a cached
copy as some sort of optimization. You should do like I told you in
your other recent email "How to download a file from a web site?" -
ie. use NSURLHandle!
With NSURLHandle you can control if a downloaded URL should be cached
or not, and flush the cache when you want to.
j o a r
On Tuesday, Apr 1, 2003, at 14:29 Europe/Stockholm, Lorenzo Puleo
wrote:
I use this
webString = [NSString stringWithContentsOfURL:myURL];
to load a text file from a web site. It works.
But after, if I update that file to that web site using some FTP
transfer
application like Transmit, the API above, doesn't load the new file,
but
always the first one. I have to restart the machine in order to load
the new
updated file. Or, I have to launch Explorer, reload the web page of
that
file, then relaunch my application.
So, how to load always the latest and most updated file?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.