Re: Downloading files via HTTP with 304 support?
Re: Downloading files via HTTP with 304 support?
- Subject: Re: Downloading files via HTTP with 304 support?
- From: Kevin Ballard <email@hidden>
- Date: Thu, 23 Sep 2004 08:18:16 -0400
On Sep 23, 2004, at 8:03 AM, Shaun Wexler wrote:
Post a plist with the latest version/sequence index of the most recent
data update. Then store a series of plists of the known services, as
files named by their sequence #. Each file in the sequence augments
or modifies the previous plist contents, so to completely reconstruct
a "current" plist, you could download each file in the sequence, and
use it to setValueForKey of the local NSMutableDictionary in the app,
and update the Application Support file in the local (or user) domain.
That way each time you add a new batch of services, you only have to
place the updated data into its own file, add it to the master plist
(downloaded by new app installs), and bump the sequence counter. When
a copy of the app checks for updates, it compares the current.plist
index against a cached value, and downloads only the new service
types. If any number in the sequence is missed, as well as for new
installs, it can just download the entire database.
I don't see the benefit to this. It would probably require more code in
RB then it would to simply add the If-Modified-Since header and to use
NSURLConnection/NSURLDownload to download the thing.
From what I can tell, the only thing this gets you is using less
bandwidth when updating the local copy, since you only download a
"patch" plist rather than a full one. I don't think that small amount
of savings is enough to justify the extra work and complexity to use
this scheme. And in fact, downloading the plist with the
version/sequence would probably offset that bandwidth savings (although
if I stopped using MacPAD and instead just used this plist for version
checking that would produce savings because this plist would be smaller
than the MacPAD plist, but I'm planning on dropping MacPAD anyway, as I
don't need the other features MacPAD provides.
In fact, it seems to me that if I were going to use an update index to
detect updates to the versions, I'd just use a simple counter and
download the master plist each time it updated and not bother with the
"patch" plists. And that's a usable scheme, I just don't know whether
it's better to do that or to do the If-Modified-Since stuff.
On Sep 23, 2004, at 8:09 AM, Shaun Wexler wrote:
The other advantage to this scheme is that you could do all version
checking, downloading and updating in a separate thread, so RB can
launch and begin running immediately, and new types would magically
appear as soon as they were downloaded and installed...
I already do version checking in a separate thread, and I could do
downloading of service types plist in a separate thread as well. RB
will already have the old type plist so I can begin running immediately
already.
Thanks for putting so much thought into helping me with this. I really
appreciate it.
--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden