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: Shaun Wexler <email@hidden>
- Date: Thu, 23 Sep 2004 05:03:09 -0700
On Sep 22, 2004, at 11:57 PM, Kevin Ballard wrote:
Maybe if I explain what this is for it will make sense. I'm trying to
make Rendezvous Browser (http://www.tildesoft.com) be able to download
new known services automatically rather than forcing me to put out an
updated version of the program simply for new service names. I figure
the best way to achieve this is to have a local plist with the known
services, and just check to see if an updated version is available
from my website on each launch. If a new version is available it will
download it and use that instead, otherwise it will continue to use
the local copy. The desire for the 304 response is so I don't keep
serving out long plists to people launching Rendezvous Browser when
they most likely already have the latest version.
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.
On the server:
file current.plist
<integer>4</integer>
file services1.plist
file services2.plist
file services3.plist
file services4.plist
file services.plist (comprised of all services 1-4)
On the clients:
file services.plist
<dict>
<key>current</key>
<integer>2<integer>
<key>services</key>
<dict/>
</dict>
In the above example, the client would load its local services.plist
file, compare the current index to the current.plist index value on the
server, download services3.plist and services4.plist, applying each to
the app's services dict in memory, then update current/services in the
local plist.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
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